diff options
author | Nathan Williams <njw@chromium.org> | 2011-04-14 13:30:15 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2011-04-14 13:30:15 -0500 |
commit | d05c87e4c80f1a56a613241d14de4faeb0a8304a (patch) | |
tree | 08585e540e8bfd8e677ac1a86c39f0b6cccb7dda /src/mm-charsets.c | |
parent | 0a06dd324dbcb255d28795eb78901fca21cc52c0 (diff) |
charset: change GSM unpack to take number of characters rather than octets
Change interface to take the number of GSM characters
rather than the number of octets, so that it is possible to
distinguish the 7-character and 8-character cases.
Diffstat (limited to 'src/mm-charsets.c')
-rw-r--r-- | src/mm-charsets.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mm-charsets.c b/src/mm-charsets.c index d2b9a667..dd1ae087 100644 --- a/src/mm-charsets.c +++ b/src/mm-charsets.c @@ -427,14 +427,13 @@ mm_charset_utf8_to_unpacked_gsm (const char *utf8, guint32 *out_len) guint8 * gsm_unpack (const guint8 *gsm, - guint32 gsm_len, + guint32 nchars, guint8 start_offset, /* in _bits_ */ guint32 *out_unpacked_len) { GByteArray *unpacked; - int i, nchars; + int i; - nchars = ((gsm_len * 8) - start_offset) / 7; unpacked = g_byte_array_sized_new (nchars + 1); for (i = 0; i < nchars; i++) { |