]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
lib: silence compiler warning in inet_ntop6
authorViktor Szakats <commit@vsz.me>
Mon, 4 Sep 2023 00:29:48 +0000 (00:29 +0000)
committerViktor Szakats <commit@vsz.me>
Mon, 4 Sep 2023 18:56:49 +0000 (18:56 +0000)
```
./curl/lib/inet_ntop.c:121:21: warning: possible misuse of comma operator here [-Wcomma]
        cur.base = i, cur.len = 1;
                    ^
./curl/lib/inet_ntop.c:121:9: note: cast expression to void to silence warning
        cur.base = i, cur.len = 1;
        ^~~~~~~~~~~~
        (void)(     )
```

Closes #11790

lib/inet_ntop.c

index fa9077376b700773048eeba9f91e30e64a1eaf3e..135f4866c65b1708b79beb49e319f83d472d7eec 100644 (file)
@@ -117,8 +117,9 @@ static char *inet_ntop6 (const unsigned char *src, char *dst, size_t size)
 
   for(i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
     if(words[i] == 0) {
-      if(cur.base == -1)
-        cur.base = i, cur.len = 1;
+      if(cur.base == -1) {
+        cur.base = i; cur.len = 1;
+      }
       else
         cur.len++;
     }