summaryrefslogtreecommitdiff
path: root/lib/if2ip.c
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2019-04-05 19:57:29 +0200
committerMarcel Raad <Marcel.Raad@teamviewer.com>2019-04-11 21:08:44 +0200
commitd1b5cf830bfe169745721b21245d2217d2c2453e (patch)
tree3f230490e3ba67789b84f94aebac29370b81092f /lib/if2ip.c
parentbb0b10135caf58f82ee9e9d38f400880a7e5c9cc (diff)
downloadcurl-d1b5cf830bfe169745721b21245d2217d2c2453e.tar.gz
build: fix Codacy/CppCheck warnings
- remove unused variables - declare conditionally used variables conditionally - suppress unused variable warnings in the CMake tests - remove dead variable stores - consistently use WIN32 macro to detect Windows Closes https://github.com/curl/curl/pull/3739
Diffstat (limited to 'lib/if2ip.c')
-rw-r--r--lib/if2ip.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/if2ip.c b/lib/if2ip.c
index acbcff71e..6e27685a0 100644
--- a/lib/if2ip.c
+++ b/lib/if2ip.c
@@ -123,7 +123,9 @@ if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope,
char ipstr[64];
#ifdef ENABLE_IPV6
if(af == AF_INET6) {
+#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
unsigned int scopeid = 0;
+#endif
unsigned int ifscope = Curl_ipv6_scope(iface->ifa_addr);
if(ifscope != remote_scope) {
@@ -149,9 +151,10 @@ if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope,
continue;
}
-#endif
+
if(scopeid)
- msnprintf(scope, sizeof(scope), "%%%u", scopeid);
+ msnprintf(scope, sizeof(scope), "%%%u", scopeid);
+#endif
}
else
#endif