comparison tests.c @ 300:385d0b40a6c8

Fix -t option handling, had a off-by one in value handling.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 22 Feb 2016 18:31:37 +0200
parents ec8357d02a52
children 5a758be2769e
comparison
equal deleted inserted replaced
299:0311f139fcf6 300:385d0b40a6c8
65 char *tmp = th_strdup_trim(pos, TH_TRIM_BOTH); 65 char *tmp = th_strdup_trim(pos, TH_TRIM_BOTH);
66 if (tmp != NULL) 66 if (tmp != NULL)
67 { 67 {
68 int val = atoi(tmp); 68 int val = atoi(tmp);
69 if (val > 0 && val <= SET_MAX_TESTS) 69 if (val > 0 && val <= SET_MAX_TESTS)
70 tests_enabled[val] = 1; 70 tests_enabled[val - 1] = 1;
71 else 71 else
72 { 72 {
73 THERR("Invalid test number #%d, out of range [%d .. %d]\n", val, 1, SET_MAX_TESTS); 73 THERR("Invalid test number #%d, out of range [%d .. %d]\n", val, 1, SET_MAX_TESTS);
74 ret = FALSE; 74 ret = FALSE;
75 } 75 }