From patchwork Thu Dec 18 15:12:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?S=C5=82awomir_Demeszko?= X-Patchwork-Id: 422588 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C390B140170 for ; Fri, 19 Dec 2014 02:13:04 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 73453283CC4; Thu, 18 Dec 2014 16:10:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id DF64428077B for ; Thu, 18 Dec 2014 16:10:33 +0100 (CET) X-policyd-weight: using cached result; rate: -7.6 Received: from hosting.nazwa24.pl (ns1.hosting.nazwa24.pl [46.242.129.143]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 18 Dec 2014 16:10:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=wireless-instruments.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From; bh=yFL2Xi4A2eSrMFD+JtVi/sejtpkFWvsVX5IJHDalwoI=; b=SEWGD5r2tcRb6qHp3iIACcq3zAZz7acEqZYX62e+U0dUHtZ9Hwhzh7cjluv6r1GFbW3LN3oiXtUfPCIc1HmYDsTwX2xiOUGzxUyVJET1AQbQD3EgZvL47bPalq6q/FR55ulidCv7s0PzSmdBzupXKOJwmIdfrUfOwFLTdKfHeOk=; Received: from afo149.internetdsl.tpnet.pl ([83.16.144.149]:45108 helo=localhost.localdomain) by hosting.nazwa24.pl with esmtpsa (UNKNOWN:AES128-SHA256:128) (Exim 4.82) (envelope-from ) id 1Y1ckV-0006bc-Hn; Thu, 18 Dec 2014 16:12:19 +0100 From: =?UTF-8?q?S=C5=82awomir=20Demeszko?= To: openwrt-devel@lists.openwrt.org Date: Thu, 18 Dec 2014 16:12:15 +0100 Message-Id: <1418915535-11838-1-git-send-email-s.demeszko@wireless-instruments.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hosting.nazwa24.pl X-AntiAbuse: Original Domain - lists.openwrt.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - wireless-instruments.com X-Get-Message-Sender-Via: hosting.nazwa24.pl: authenticated_id: s.demeszko@wireless-instruments.com Cc: =?UTF-8?q?S=C5=82awomir=20Demeszko?= Subject: [OpenWrt-Devel] [PATCH uqmi] Fix encoding phone number on sending sms X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Return proper length of encoded phone number with odd count of digits, without this patch number is encoded in memory but length returned by function is not incremented and sms cannot be send. Signed-off-by: SÅ‚awomir Demeszko --- commands-wms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands-wms.c b/commands-wms.c index b85cd70..02874f0 100644 --- a/commands-wms.c +++ b/commands-wms.c @@ -512,7 +512,7 @@ pdu_encode_semioctet(unsigned char *dest, const char *str) str++; } - return len; + return lower ? len : (len + 1); } static int