[master] 8aa382f Flexelinting

Poul-Henning Kamp phk at FreeBSD.org
Thu Nov 2 15:06:07 UTC 2017


commit 8aa382fe436c0fe9e120c69201b4c3b6899b301f
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Nov 2 15:04:07 2017 +0000

    Flexelinting

diff --git a/lib/libvmod_blob/hex.c b/lib/libvmod_blob/hex.c
index b65b07e..4124100 100644
--- a/lib/libvmod_blob/hex.c
+++ b/lib/libvmod_blob/hex.c
@@ -106,6 +106,7 @@ hex_decode(const enum encoding dec, char *restrict const buf,
 	   const char *restrict const p, va_list ap)
 {
 	char *dest = buf;
+	const char *b;
 	unsigned char extranib = 0;
 	ssize_t len = 0;
 	va_list ap2;
@@ -116,13 +117,15 @@ hex_decode(const enum encoding dec, char *restrict const buf,
 	va_copy(ap2, ap);
 	for (const char *s = p; s != vrt_magic_string_end;
 	     s = va_arg(ap2, const char *)) {
-		const char *b = s;
-		if (s != NULL)
-			while (*s)
-				if (!isxdigit(*s++)) {
-					len = -1;
-					break;
-				}
+		if (s == NULL)
+			continue;
+		b = s;
+		while (*s) {
+			if (!isxdigit(*s++)) {
+				len = -1;
+				break;
+			}
+		}
 		if (len == -1)
 			break;
 		len += s - b;


More information about the varnish-commit mailing list