Skip to content

Commit c8cf0fb

Browse files
committed
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]
1 parent 2ee9147 commit c8cf0fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mbw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ int main(int argc, char **argv)
210210
break;
211211
case 't': /* test to run */
212212
testno=strtoul(optarg, (char **)NULL, 10);
213-
if(0>testno) {
214-
printf("Error: test number must be between 0 and %d\n", MAX_TESTS);
213+
if(testno>MAX_TESTS-1) {
214+
printf("Error: test number must be between 0 and %d\n", MAX_TESTS-1);
215215
exit(1);
216216
}
217217
tests[testno]=1;

0 commit comments

Comments
 (0)