[Pdbg] [PATCH 6/6] path: Fix clang warning -Wpointer-bool-conversion

Amitay Isaacs amitay at ozlabs.org
Wed Jun 19 13:15:50 AEST 2019


./../src/path.c:126:12: error: address of array 'pat->prefix' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
        if (!pat->prefix)

Check if pat->prefix is not a null string.

Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
 src/path.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/path.c b/src/path.c
index e6c9d94..a80a288 100644
--- a/src/path.c
+++ b/src/path.c
@@ -123,7 +123,7 @@ static bool path_pattern_parse(const char *arg, struct path_pattern *pat)
 		safe_strcpy(pat->prefix, sizeof(pat->prefix), tmp);
 	}
 
-	if (!pat->prefix)
+	if (!pat->prefix[0])
 		return false;
 
 	return true;
-- 
2.21.0



More information about the Pdbg mailing list