diff options
author | erin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2008-09-02 08:26:48 +0000 |
---|---|---|
committer | erin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2008-09-02 08:26:48 +0000 |
commit | d822e692f1179b823a6eda8130f8ca8bcbe47d1d (patch) | |
tree | 80325c366f8185ae488a65477e8e2a45c7da008a /src/libgsmd | |
parent | 45973084b27f4540ecc9a19117cad9bf9230bdc5 (diff) |
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
Diffstat (limited to 'src/libgsmd')
-rw-r--r-- | src/libgsmd/libgsmd_sms.c | 6 |
1 files changed, 4 insertions, 2 deletions
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) |