From d822e692f1179b823a6eda8130f8ca8bcbe47d1d Mon Sep 17 00:00:00 2001 From: erin_yueh Date: Tue, 2 Sep 2008 08:26:48 +0000 Subject: adjust return length for ticket #1591 (Erin Yueh) git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@4618 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/libgsmd/libgsmd_sms.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libgsmd') diff --git a/src/libgsmd/libgsmd_sms.c b/src/libgsmd/libgsmd_sms.c index b13dacb..4e08e92 100644 --- a/src/libgsmd/libgsmd_sms.c +++ b/src/libgsmd/libgsmd_sms.c @@ -290,9 +290,11 @@ int packing_7bit_character(const char *src, struct lgsm_sms *dest) int unpacking_7bit_character(const struct gsmd_sms *src, char *dest) { int i = 0; + int l = 0; if (src->has_header) - i += ((src->data[0] << 3) + 14) / 7; + l += ((src->data[0] << 3) + 14) / 7; + i += l; for (; i < src->length; i ++) *(dest ++) = ((src->data[(i * 7 + 7) >> 3] << @@ -301,7 +303,7 @@ int unpacking_7bit_character(const struct gsmd_sms *src, char *dest) ((i * 7) & 7))) & 0x7f; *dest = '\0'; - return i; + return i - l; } int cbm_unpacking_7bit_character(const char *src, char *dest) -- cgit v1.2.3