From: Viktor Szakats Date: Mon, 4 Sep 2023 00:29:48 +0000 (+0000) Subject: lib: silence compiler warning in inet_ntop6 X-Git-Tag: curl-8_3_0~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a6287d72675ed9a3a0daf4adb9fe92dfd217f9d;p=thirdparty%2Fcurl.git lib: silence compiler warning in inet_ntop6 ``` ./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 --- diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c index fa9077376b..135f4866c6 100644 --- a/lib/inet_ntop.c +++ b/lib/inet_ntop.c @@ -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++; }