From c8cf0fb5c6cf772414f683700aa4f0620a7af0c4 Mon Sep 17 00:00:00 2001 From: Steve Schnepp Date: Thu, 14 May 2020 21:12:05 +0200 Subject: Fix the test for -t which was inverted Found because GCC 6.4.0 emits a warning: warning: comparison of 0 > unsigned expression is always false [-Wtautological-compare] --- mbw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mbw.c') diff --git a/mbw.c b/mbw.c index c2e90e1..acfbcff 100644 --- a/mbw.c +++ b/mbw.c @@ -210,8 +210,8 @@ int main(int argc, char **argv) break; case 't': /* test to run */ testno=strtoul(optarg, (char **)NULL, 10); - if(0>testno) { - printf("Error: test number must be between 0 and %d\n", MAX_TESTS); + if(testno>MAX_TESTS-1) { + printf("Error: test number must be between 0 and %d\n", MAX_TESTS-1); exit(1); } tests[testno]=1; -- cgit v1.2.3