From 24a43404b4335a9c037746bc73fab3ffbd4875e1 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 11 Dec 2016 22:27:40 +0000 Subject: [PATCH] Fix a compile failure with NO_IPV6. 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/winnet.c b/windows/winnet.c index fa2de809..b4264def 100644 --- a/windows/winnet.c +++ b/windows/winnet.c @@ -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; -- 2.45.2