[PATCH] * when comparing the coded result with the expected coded values, do not compare n bytes where n is the result of gsm_7bit_encode() but the actual length of the input string as gsm_7bit_encode() returns the number of septets not octets

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Nico Golde nico at ngolde.de
Mon Jul 19 21:01:50 UTC 2010


---
 tests/sms/sms_test.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/sms/sms_test.c b/tests/sms/sms_test.c
index 3742dd8..cab91ab 100644
--- a/tests/sms/sms_test.c
+++ b/tests/sms/sms_test.c
@@ -99,7 +99,7 @@ int main(int argc, char** argv)
 			return -1;
 		}
 
-		if (memcmp(coded, test_encode[i].expected, length) != 0) {
+		if (memcmp(coded, test_encode[i].expected, strlen(test_encode[i].expected)) != 0) {
 			fprintf(stderr, "Encoded content does not match for %d\n",
 				i);
 			return -1;
-- 
1.7.1


--Kj7319i9nmIyA2yE--




More information about the OpenBSC mailing list