diff options
author | David Robillard <d@drobilla.net> | 2021-07-02 13:56:21 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-07-17 19:58:17 -0400 |
commit | 0945afa159d0da327d4da8d2c4e7d345d308cd97 (patch) | |
tree | b7a8ff9a111ec53cfc0d07d933be968a8a9a8787 /benchmark/dict_bench.c | |
parent | 5942e985c6ac9b18090ec92b11aa8a586b6365c5 (diff) | |
download | zix-0945afa159d0da327d4da8d2c4e7d345d308cd97.tar.gz zix-0945afa159d0da327d4da8d2c4e7d345d308cd97.tar.bz2 zix-0945afa159d0da327d4da8d2c4e7d345d308cd97.zip |
Avoid allegedly "suspicious" string comparisons
I guess these are suspicious if you've never seen C before?
Diffstat (limited to 'benchmark/dict_bench.c')
-rw-r--r-- | benchmark/dict_bench.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/benchmark/dict_bench.c b/benchmark/dict_bench.c index 4a77257..90b0abc 100644 --- a/benchmark/dict_bench.c +++ b/benchmark/dict_bench.c @@ -165,7 +165,7 @@ main(int argc, char** argv) for (size_t i = 0; i < n; ++i) { const size_t index = lcg64(seed + i) % n; char* match = (char*)g_hash_table_lookup(hash, strings[index]); - if (strcmp(match, strings[index])) { + if (!!strcmp(match, strings[index])) { return test_fail("Bad match for `%s'\n", strings[index]); } } @@ -181,7 +181,7 @@ main(int argc, char** argv) return test_fail("Hash: Failed to find `%s'\n", strings[index]); } - if (strcmp((const char*)match->buf, strings[index])) { + if (!!strcmp((const char*)match->buf, strings[index])) { return test_fail("Hash: Bad match %p for `%s': `%s'\n", (const void*)match, strings[index], |