mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Fix warnings when compiling with -DNO_IPV6.
A user pointed out that 'family' was uninitialised in config.c, and when I tried test-building with -DNO_IPV6 (and the usual -Werror, of course) some unused variables showed up in uxnet.c too. [originally from svn r10135]
This commit is contained in:
parent
c29ab648b9
commit
e00a004e64
2
config.c
2
config.c
@ -1127,8 +1127,8 @@ static void portfwd_handler(union control *ctrl, void *dlg,
|
||||
else if (whichbutton == 2)
|
||||
family = "6";
|
||||
else
|
||||
family = "";
|
||||
#endif
|
||||
family = "";
|
||||
|
||||
whichbutton = dlg_radiobutton_get(pfd->direction, dlg);
|
||||
if (whichbutton == 0)
|
||||
|
12
unix/uxnet.c
12
unix/uxnet.c
@ -331,9 +331,7 @@ void sk_getaddr(SockAddr addr, char *buf, int buflen)
|
||||
}
|
||||
#else
|
||||
struct in_addr a;
|
||||
SockAddrStep step;
|
||||
START_STEP(addr, step);
|
||||
assert(SOCKADDR_FAMILY(addr, step) == AF_INET);
|
||||
assert(SOCKADDR_FAMILY(addr, ignored_macro_parameter) == AF_INET);
|
||||
a.s_addr = htonl(addr->addresses[0]);
|
||||
strncpy(buf, inet_ntoa(a), buflen);
|
||||
buf[buflen-1] = '\0';
|
||||
@ -388,9 +386,7 @@ int sk_address_is_local(SockAddr addr)
|
||||
return sockaddr_is_loopback(addr->ais->ai_addr);
|
||||
#else
|
||||
struct in_addr a;
|
||||
SockAddrStep step;
|
||||
START_STEP(addr, step);
|
||||
assert(SOCKADDR_FAMILY(addr, step) == AF_INET);
|
||||
assert(SOCKADDR_FAMILY(addr, ignored_macro_parameter) == AF_INET);
|
||||
a.s_addr = htonl(addr->addresses[0]);
|
||||
return ipv4_is_loopback(a);
|
||||
#endif
|
||||
@ -404,10 +400,8 @@ int sk_address_is_special_local(SockAddr addr)
|
||||
|
||||
int sk_addrtype(SockAddr addr)
|
||||
{
|
||||
SockAddrStep step;
|
||||
int family;
|
||||
START_STEP(addr, step);
|
||||
family = SOCKADDR_FAMILY(addr, step);
|
||||
family = SOCKADDR_FAMILY(addr, ignored_macro_parameter);
|
||||
|
||||
return (family == AF_INET ? ADDRTYPE_IPV4 :
|
||||
#ifndef NO_IPV6
|
||||
|
Loading…
Reference in New Issue
Block a user