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 /test/strindex_test.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 'test/strindex_test.c')
-rw-r--r-- | test/strindex_test.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/strindex_test.c b/test/strindex_test.c index 3cdfb25..bd6a389 100644 --- a/test/strindex_test.c +++ b/test/strindex_test.c @@ -52,7 +52,7 @@ main(void) "No match for substring at %" PRIuPTR " length %" PRIuPTR "\n", i, l); } - if (strncmp(str + i, match, l)) { + if (!!strncmp(str + i, match, l)) { return test_fail("Bad match for substring at %" PRIuPTR " length %" PRIuPTR "\n", i, |