Fix encoding phone number on sending sms
authorSławomir Demeszko <s.demeszko@wireless-instruments.com>
Thu, 18 Dec 2014 15:12:15 +0000 (16:12 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 22 Dec 2014 20:44:14 +0000 (21:44 +0100)
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 <s.demeszko@wireless-instruments.com>
commands-wms.c

index 345b81210338cbdb41ff456af5930cda4b699a8f..e3bcbc87eaeb14cf7ce59e88327a94fb77872ce9 100644 (file)
@@ -512,7 +512,7 @@ pdu_encode_semioctet(unsigned char *dest, const char *str)
                str++;
        }
 
-       return len;
+       return lower ? len : (len + 1);
 }
 
 static int