diff mbox

[OpenWrt-Devel,uqmi] Fix encoding phone number on sending sms

Message ID 1418915535-11838-1-git-send-email-s.demeszko@wireless-instruments.com
State Accepted
Headers show

Commit Message

Sławomir Demeszko Dec. 18, 2014, 3:12 p.m. UTC
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Felix Fietkau Dec. 22, 2014, 8:44 p.m. UTC | #1
On 2014-12-18 16:12, Sławomir Demeszko wrote:
> 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>
Applied, thanks.

- Felix
diff mbox

Patch

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