summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraas <andras.horvath@gmail.com>2020-05-15 10:15:01 +0200
committerGitHub <noreply@github.com>2020-05-15 10:15:01 +0200
commit2a15026ff65160127204881263464b1740a57198 (patch)
treecfc5feb5b9eb617225f6662db6eda4949e97635a
parent2ee91478bc634a1f132b6ffcbef9170fbfc838c4 (diff)
parentc8cf0fb5c6cf772414f683700aa4f0620a7af0c4 (diff)
Merge pull request #11 from steveschnepp/fix-testno-comparison
Fix the test for -t which was inverted.
-rw-r--r--mbw.c4
1 files changed, 2 insertions, 2 deletions
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;