1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-05-28 15:24:49 -05:00

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.
This commit is contained in:
Simon Tatham 2016-12-11 22:27:40 +00:00
parent 09b74971c7
commit 24a43404b4

View 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;