diff --git a/tests/ampctl_parse.c b/tests/ampctl_parse.c index 298fe075b..7f970e3e5 100644 --- a/tests/ampctl_parse.c +++ b/tests/ampctl_parse.c @@ -263,7 +263,7 @@ void hash_add_model(int id, /* Hash sorting functions */ int hash_model_id_sort(struct mod_lst *a, struct mod_lst *b) { - return (a->id - b->id); + return (a->id > b->id); } diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index c3dc59b61..d0748d37b 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -329,7 +329,7 @@ static struct test_table *find_cmd_entry(int cmd) { int i; - for (i = 0; i < MAXNBOPT && test_list[i].cmd != 0x00; i++) + for (i = 0; test_list[i].cmd != 0x00; i++) { if (test_list[i].cmd == cmd) { @@ -390,7 +390,7 @@ void hash_add_model(int id, /* Hash sorting functions */ int hash_model_id_sort(struct mod_lst *a, struct mod_lst *b) { - return (a->id - b->id); + return (a->id > b->id); } @@ -453,7 +453,7 @@ static char parse_arg(const char *arg) { int i; - for (i = 0; i < MAXNBOPT && test_list[i].cmd != 0; i++) + for (i = 0; test_list[i].cmd != 0x00; i++) { if (!strncmp(arg, test_list[i].name, MAXNAMSIZ)) { diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index 039c85c42..6af9b7192 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -234,7 +234,7 @@ struct test_table *find_cmd_entry(int cmd) { int i; - for (i = 0; i < MAXNBOPT && test_list[i].cmd != 0x00; i++) + for (i = 0; test_list[i].cmd != 0x00; i++) if (test_list[i].cmd == cmd) { break; @@ -292,7 +292,7 @@ void hash_add_model(int id, /* Hash sorting functions */ int hash_model_id_sort(struct mod_lst *a, struct mod_lst *b) { - return (a->id - b->id); + return (a->id > b->id); }