diff options
author | Steve Schnepp <steve.schnepp@pwkf.org> | 2020-05-14 21:12:05 +0200 |
---|---|---|
committer | Steve Schnepp <steve.schnepp@pwkf.org> | 2020-05-14 21:14:14 +0200 |
commit | c8cf0fb5c6cf772414f683700aa4f0620a7af0c4 (patch) | |
tree | cfc5feb5b9eb617225f6662db6eda4949e97635a | |
parent | 2ee91478bc634a1f132b6ffcbef9170fbfc838c4 (diff) |
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]
-rw-r--r-- | mbw.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |