mirror of git://git.sysmocom.de/ofono
smsutil: Fix CR padding logic for 7-bit case
This commit is contained in:
parent
134a35f697
commit
941257bec6
|
@ -4103,11 +4103,19 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CR is a padding character, which means we can
|
* CR is a padding character, which means we can
|
||||||
* safely discard everything afterwards
|
* safely discard everything afterwards if there are
|
||||||
|
* only trailing CR characters.
|
||||||
*/
|
*/
|
||||||
for (; i < written; i++, bufsize++) {
|
for (; i < written; i++, bufsize++) {
|
||||||
if (unpacked[i] == '\r')
|
if (unpacked[i] == '\r') {
|
||||||
break;
|
unsigned int t;
|
||||||
|
|
||||||
|
t = strspn((const char *) unpacked + i,
|
||||||
|
"\r");
|
||||||
|
|
||||||
|
if (t + i == written)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
buf[bufsize] = unpacked[i];
|
buf[bufsize] = unpacked[i];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue