File 0004-Fix-klee-libc-memchr.c-compiler-warning.patch of Package klee

From: Martin Nowack <m.nowack@imperial.ac.uk>
Date: Thu, 12 Oct 2023 10:34:01 +0100
Subject: Fix `klee-libc/memchr.c` compiler warning
Patch-mainline: no
References: llvm16

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 runtime/klee-libc/memchr.c | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/runtime/klee-libc/memchr.c b/runtime/klee-libc/memchr.c
index fe0670a7..3cd47cdf 100644
--- a/runtime/klee-libc/memchr.c
+++ b/runtime/klee-libc/memchr.c
@@ -36,19 +36,14 @@
 
 #include <string.h>
 
-void *
-memchr(s, c, n)
-	const void *s;
-	int c;
-	size_t n;
-{
-	if (n != 0) {
-		const unsigned char *p = s;
+void *memchr(const void *s, int c, size_t n) {
+  if (n != 0) {
+    const unsigned char *p = s;
 
-		do {
-			if (*p++ == c)
-				return ((void *)(p - 1));
-		} while (--n != 0);
-	}
-	return (NULL);
+    do {
+      if (*p++ == c)
+        return ((void *)(p - 1));
+    } while (--n != 0);
+  }
+  return (NULL);
 }
-- 
2.43.0

openSUSE Build Service is sponsored by