mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-12 18:13:50 -05:00
Another warning fix and cosmetic tweakage.
[originally from svn r8665]
This commit is contained in:
parent
a83a9cc2a3
commit
53e2b1f865
@ -429,10 +429,8 @@ SockAddr sk_namelookup(const char *host, char **canonicalname,
|
||||
{
|
||||
SockAddr ret = snew(struct SockAddr_tag);
|
||||
unsigned long a;
|
||||
struct hostent *h = NULL;
|
||||
char realhost[8192];
|
||||
int hint_family;
|
||||
int err;
|
||||
|
||||
/* Default to IPv4. */
|
||||
hint_family = (address_family == ADDRTYPE_IPV4 ? AF_INET :
|
||||
@ -452,6 +450,8 @@ SockAddr sk_namelookup(const char *host, char **canonicalname,
|
||||
*realhost = '\0';
|
||||
|
||||
if ((a = p_inet_addr(host)) == (unsigned long) INADDR_NONE) {
|
||||
struct hostent *h = NULL;
|
||||
int err;
|
||||
#ifndef NO_IPV6
|
||||
/*
|
||||
* Use getaddrinfo when it's available
|
||||
@ -585,8 +585,10 @@ void sk_getaddr(SockAddr addr, char *buf, int buflen)
|
||||
#ifndef NO_IPV6
|
||||
if (step.ai) {
|
||||
if (p_WSAAddressToStringA) {
|
||||
DWORD dwbuflen;
|
||||
p_WSAAddressToStringA(step.ai->ai_addr, step.ai->ai_addrlen,
|
||||
NULL, buf, &buflen);
|
||||
NULL, buf, &dwbuflen);
|
||||
buflen = dwbuflen;
|
||||
} else
|
||||
strncpy(buf, "IPv6", buflen);
|
||||
} else
|
||||
|
Loading…
x
Reference in New Issue
Block a user