From 0945afa159d0da327d4da8d2c4e7d345d308cd97 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 2 Jul 2021 13:56:21 -0400 Subject: Avoid allegedly "suspicious" string comparisons I guess these are suspicious if you've never seen C before? --- test/strindex_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/strindex_test.c') 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, -- cgit v1.2.1