[PATCH] openbsc[master]: gsm0408_test.c: Don't pass negative value to strerror()

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/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat Nov 26 14:08:48 UTC 2016


Review at  https://gerrit.osmocom.org/1327

gsm0408_test.c: Don't pass negative value to strerror()

Change-Id: I4fcf24ec1bc974a3189486d2372b9713d7fdab70
Fixes: Coverity CID 135192
---
M openbsc/tests/gsm0408/gsm0408_test.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/27/1327/1

diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c
index e81394f..8e2f30d 100644
--- a/openbsc/tests/gsm0408/gsm0408_test.c
+++ b/openbsc/tests/gsm0408/gsm0408_test.c
@@ -88,7 +88,7 @@
 {
 	int r = osmo_earfcn_add(e, earfcn, bw);
 	if (r)
-		printf("failed to add EARFCN %u: %s\n", earfcn, strerror(r));
+		printf("failed to add EARFCN %u: %s\n", earfcn, strerror(-r));
 	else
 		printf("added EARFCN %u - ", earfcn);
 }

-- 
To view, visit https://gerrit.osmocom.org/1327
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4fcf24ec1bc974a3189486d2372b9713d7fdab70
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list