patch 8.2.0837: compiler warning for value set but not used
Problem: Compiler warning for value set but not used.
Solution: Move variable inside #ifdef.
diff --git a/src/channel.c b/src/channel.c
index 2b85ec9..6f182c1 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -999,10 +999,9 @@
for (addr = res; addr != NULL; addr = addr->ai_next)
{
const char *dst = hostname;
- const void *src = NULL;
# ifdef HAVE_INET_NTOP
+ const void *src = NULL;
char buf[NUMBUFLEN];
-# endif
if (addr->ai_family == AF_INET6)
{
@@ -1018,7 +1017,6 @@
sai->sin_port = htons(port);
src = &sai->sin_addr;
}
-# ifdef HAVE_INET_NTOP
if (src != NULL)
{
dst = inet_ntop(addr->ai_family, src, buf, sizeof(buf));