38cfe28
From f4952ecf70ab6de206d63f24d050f4303eccce45 Mon Sep 17 00:00:00 2001
38cfe28
From: Peter Jones <pjones@redhat.com>
38cfe28
Date: Thu, 30 Jan 2020 10:47:11 -0500
38cfe28
Subject: [PATCH 73/86] makeguids: confuse ccc-analyzer less.
38cfe28
38cfe28
Putting the non-NULL and non-NUL tests inside the loop confuses
38cfe28
ccc-analyzer into thinking it might be NULL later when we pass it to
38cfe28
strchr().
38cfe28
38cfe28
It can't, but I like a clean scan.
38cfe28
38cfe28
Signed-off-by: Peter Jones <pjones@redhat.com>
38cfe28
---
38cfe28
 src/makeguids.c | 8 +++++---
38cfe28
 1 file changed, 5 insertions(+), 3 deletions(-)
38cfe28
38cfe28
diff --git a/src/makeguids.c b/src/makeguids.c
38cfe28
index f12dac3bb15..c0a9db1509c 100644
38cfe28
--- a/src/makeguids.c
38cfe28
+++ b/src/makeguids.c
38cfe28
@@ -141,9 +141,11 @@ main(int argc, char *argv[])
38cfe28
 
38cfe28
 	char *guidstr = inbuf;
38cfe28
 	unsigned int line;
38cfe28
-	for (line = 1; (uintptr_t)guidstr - (uintptr_t)inbuf < inlen; line++) {
38cfe28
-		if (guidstr && guidstr[0] == '\0')
38cfe28
-			break;
38cfe28
+	for (line = 1;
38cfe28
+	     guidstr && guidstr[0] != '\0' &&
38cfe28
+		(uintptr_t)guidstr - (uintptr_t)inbuf < inlen;
38cfe28
+	     line++) {
38cfe28
+
38cfe28
 		outbuf = realloc(outbuf, line * sizeof (struct guidname));
38cfe28
 		if (!outbuf)
38cfe28
 			err(1, "makeguids");
38cfe28
-- 
38cfe28
2.24.1
38cfe28