diff options
-rw-r--r-- | src/gsm/gsm48_ie.c | 4 | ||||
-rw-r--r-- | tests/gsm0408/gsm0408_test.ok | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/gsm/gsm48_ie.c b/src/gsm/gsm48_ie.c index ca6489a9..48d0d379 100644 --- a/src/gsm/gsm48_ie.c +++ b/src/gsm/gsm48_ie.c @@ -88,16 +88,16 @@ int gsm48_decode_bcd_number2(char *output, size_t output_len, for (i = 1 + h_len; i <= in_len; i++) { /* lower nibble */ - output_len--; if (output_len <= 1) break; *output++ = bcd_num_digits[bcd_lv[i] & 0xf]; + output_len--; /* higher nibble */ - output_len--; if (output_len <= 1) break; *output++ = bcd_num_digits[bcd_lv[i] >> 4]; + output_len--; } if (output_len >= 1) *output++ = '\0'; diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index 2441b2b4..3938e870 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -167,14 +167,14 @@ BSD number encoding / decoding test - Actual: (rc=9) '0821436587092143f5' - Decoding HEX (buffer limit=16) '0821436587092143f5'... - Expected: (rc=0) '123456789012345' - - Actual: (rc=0) '12345678901234' + - Actual: (rc=0) '123456789012345' - Running test: to be truncated 20-digit MSISDN - Encoding ASCII (buffer limit=9) '12345678901234567890'... - Expected: (rc=-5) '' - Actual: (rc=-5) '' - Decoding HEX (buffer limit=16) '0a21436587092143658709'... - Expected: (rc=0) '123456789012345' - - Actual: (rc=0) '12345678901234' + - Actual: (rc=0) '123456789012345' - Running test: LV incorrect length - Decoding HEX (buffer limit=0) '05214365'... - Expected: (rc=-5) '(none)' |