From 627e0113d142c91eaf9a750ab76b722bb776b1ce Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 5 Dec 2018 21:32:40 +0100 Subject: gsm48_mi_to_string: use osmo_bcd2str(), fix some corner cases By using osmo_bcd2str(), ensure that the resulting string is always nul terminated, and always return strlen()+1 whether truncated or not. Still keep up the previous return value style, even if that isn't consistent at all. The difference between IMSI/IMEI and TMSI return values remains and is not part of this patch. Change-Id: I1b51b72a721e1cc9d69796b804ebda741ff0f36b --- tests/gsm0408/gsm0408_test.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'tests/gsm0408/gsm0408_test.c') diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 24f903a7..c786d389 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -393,7 +393,6 @@ static const struct test_mid_encode_decode_test test_mid_encode_decode_tests[] = .expect_mi_tlv_hex = "170449322453", .str_size = 4, .expect_str = "423", - .expect_rc = 3, /* exception: on truncation, gsm48_mi_to_string() returns strlen(), not bytes! */ }, { .mi_type = GSM_MI_TYPE_IMEI, @@ -421,7 +420,6 @@ static const struct test_mid_encode_decode_test test_mid_encode_decode_tests[] = .expect_mi_tlv_hex = "170a937856341290785634f2", .str_size = 16, .expect_str = "987654321098765", - .expect_rc = 15, /* exception: on truncation, gsm48_mi_to_string() returns strlen(), not bytes! */ }, { /* gsm48 treats TMSI as decimal string */ -- cgit v1.2.3