Fix improper characters after reading Escape code for switching extension table in SMS
authorSławomir Demeszko <s.demeszko@wireless-instruments.com>
Wed, 17 Dec 2014 16:14:53 +0000 (17:14 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 18 Dec 2014 12:04:38 +0000 (13:04 +0100)
Escape code 0x1b is a prefix indicating that next character should be
represented from extension table, but it only applies to one character,
so switching it off is needed to read further characters correctly.

Signed-off-by: SÅ‚awomir Demeszko <s.demeszko@wireless-instruments.com>
commands-wms.c

index 6ac52ebb5002519ce0e598ae57423d6de94243a9..b85cd705b94dfd93a3bc90161d14e9043d15baff 100644 (file)
@@ -70,6 +70,7 @@ pdu_decode_7bit_char(char *dest, int len, unsigned char c, bool *escape)
        fprintf(stderr, " %02x", c);
        dest += len;
        if (*escape) {
+               *escape = false;
                switch(c) {
                case 0x0A:
                        *dest = 0x0C;