]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix a compile failure with NO_IPV6.
authorSimon Tatham <anakin@pobox.com>
Sun, 11 Dec 2016 22:27:40 +0000 (22:27 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 11 Dec 2016 22:27:40 +0000 (22:27 +0000)
A user points out that buf[] in sk_tcp_peer_info is only used in the
IPv6 branch of an ifdef, and is declared with a size of
INET6_ADDRSTRLEN, which won't be defined in NO_IPV6 mode. So moving
the definition inside another IPv6-only ifdef fixes the resulting
build failure.

windows/winnet.c

index fa2de80967565e91cd7161512fd2646f7d563bfc..b4264def43d367a8bec58ef19be051e5aa16470a 100644 (file)
@@ -1761,9 +1761,9 @@ static char *sk_tcp_peer_info(Socket sock)
     struct sockaddr_in addr;
 #else
     struct sockaddr_storage addr;
+    char buf[INET6_ADDRSTRLEN];
 #endif
     int addrlen = sizeof(addr);
-    char buf[INET6_ADDRSTRLEN];
 
     if (p_getpeername(s->s, (struct sockaddr *)&addr, &addrlen) < 0)
         return NULL;