From 2eca3218ca1ac8fa582f86ab5f055474ad369d7d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 10 Dec 2022 12:56:44 -0500 Subject: Fix "suspicious" string comparisons --- src/.clang-tidy | 1 - src/sratom.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/.clang-tidy b/src/.clang-tidy index 1b4b226..c50cd8a 100644 --- a/src/.clang-tidy +++ b/src/.clang-tidy @@ -5,7 +5,6 @@ Checks: > -*-magic-numbers, -*-narrowing-conversions, -bugprone-easily-swappable-parameters, - -bugprone-suspicious-string-compare, -cert-err33-c, -cert-err34-c, -clang-analyzer-unix.Malloc, diff --git a/src/sratom.c b/src/sratom.c index fd984d0..2222dd4 100644 --- a/src/sratom.c +++ b/src/sratom.c @@ -282,7 +282,7 @@ sratom_write(Sratom* sratom, object = serd_node_new_file_uri(str, NULL, NULL, true); } else { if (!sratom->base_uri.buf || - strncmp((const char*)sratom->base_uri.buf, "file://", 7)) { + !!strncmp((const char*)sratom->base_uri.buf, "file://", 7)) { fprintf(stderr, "warning: Relative path but base is not a file URI.\n"); fprintf(stderr, "warning: Writing ambiguous atom:Path literal.\n"); object = serd_node_from_string(SERD_LITERAL, str); -- cgit v1.2.1