shithub: riscv

Download patch

ref: 69a3f67965aca6e8a5554c816319da92a82b3a1a
parent: 768edd8f215e4576070170af6bfa4f6d83b8bc22
author: cinap_lenrek <[email protected]>
date: Fri Jan 6 14:22:31 EST 2023

libip: avoid parentesis warnings from gcc (from drawterm)

--- a/sys/src/libip/parseip.c
+++ b/sys/src/libip/parseip.c
@@ -40,7 +40,7 @@
 static int
 ipcharok(int c)
 {
-	return c == '.' || c == ':' || isascii(c) && isxdigit(c);
+	return c == '.' || c == ':' || (isascii(c) && isxdigit(c));
 }
 
 static int
@@ -48,7 +48,7 @@
 {
 	if(c == '\0')
 		return 1;
-	if(c == '.' || c == ':' || isascii(c) && isalnum(c))
+	if(c == '.' || c == ':' || (isascii(c) && isalnum(c)))
 		return 0;
 	return 1;
 }
@@ -83,7 +83,7 @@
 			break;
 		}
 		/* v6: at most 4 hex digits, followed by colon or delim */
-		if(x != (ushort)x || *p != ':' && !delimchar(*p)) {
+		if(x != (ushort)x || (*p != ':' && !delimchar(*p))) {
 			memset(to, 0, IPaddrlen);
 			return -1;			/* parse error */
 		}