huawei: remove padding from USSD responses
Probably needed in generic USSD code.
This commit is contained in:
committed by
Dan Williams
parent
262f0f5e81
commit
71598a6289
@@ -916,8 +916,11 @@ ussd_decode (MMModemGsmUssd *self, const char* reply, guint scheme)
|
||||
guint32 unpacked_len;
|
||||
|
||||
bin = utils_hexstr2bin (reply, &bin_len);
|
||||
unpacked = gsm_unpack ((guint8*)bin, bin_len, 0, &unpacked_len);
|
||||
utf8 = (char*)mm_charset_gsm_unpacked_to_utf8 (unpacked, unpacked_len);
|
||||
unpacked = gsm_unpack ((guint8*) bin, (bin_len * 8) / 7, 0, &unpacked_len);
|
||||
/* if the last character in a 7-byte block is padding, then drop it */
|
||||
if ((bin_len % 7 == 0) && (unpacked[unpacked_len - 1] == 0x0d))
|
||||
unpacked_len--;
|
||||
utf8 = (char*) mm_charset_gsm_unpacked_to_utf8 (unpacked, unpacked_len);
|
||||
|
||||
g_free (bin);
|
||||
g_free (unpacked);
|
||||
|
||||
Reference in New Issue
Block a user