summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Golde <nico@ngolde.de>2012-09-20 16:56:23 +0200
committerHarald Welte <laforge@gnumonks.org>2012-09-21 09:25:08 +0200
commit5b67a04a34cb2e6ed2ee441b87bda12dca39626f (patch)
tree04a685e90c4467d67512e4713f477d77bc0ef4af
parentbe55a8b81482a0cd4a97dfcd1156b6954497280f (diff)
gsm_utils.c: in 7bit decoding, first check if the last character was an extension character before doing anything else
-rw-r--r--src/gsm/gsm_utils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c
index 6af0a5ff..8b1fae08 100644
--- a/src/gsm/gsm_utils.c
+++ b/src/gsm/gsm_utils.c
@@ -146,15 +146,15 @@ int gsm_7bit_decode_hdr(char *text, const uint8_t *user_data, uint8_t septet_l,
(user_data[((i + shift) * 7) >> 3] >>
(((i + shift) * 7) & 7))) & 0x7f;
- if (c == 0x1b && i + 1 < septet_l) {
- next_is_ext = 1;
- continue;
- }
-
/* this is an extension character */
if (next_is_ext) {
next_is_ext = 0;
*(text++) = gsm_7bit_alphabet[0x7f + c];
+ continue;
+ }
+
+ if (c == 0x1b && i + 1 < septet_l) {
+ next_is_ext = 1;
} else {
*(text++) = gsm_septet_lookup(c);
}