projects
/
platform
/
upstream
/
ofono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
134a35f
)
smsutil: Fix CR padding logic for 7-bit case
author
Denis Kenzior
<denkenz@gmail.com>
Mon, 17 Sep 2012 16:48:03 +0000
(11:48 -0500)
committer
Denis Kenzior
<denkenz@gmail.com>
Mon, 17 Sep 2012 16:48:03 +0000
(11:48 -0500)
src/smsutil.c
patch
|
blob
|
history
diff --git
a/src/smsutil.c
b/src/smsutil.c
index
b4d129f
..
1e9b471
100644
(file)
--- a/
src/smsutil.c
+++ b/
src/smsutil.c
@@
-4103,11
+4103,19
@@
char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
/*
* 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++) {
- if (unpacked[i] == '\r')
- break;
+ if (unpacked[i] == '\r') {
+ unsigned int t;
+
+ t = strspn((const char *) unpacked + i,
+ "\r");
+
+ if (t + i == written)
+ break;
+ }
buf[bufsize] = unpacked[i];
}