зеркало из https://github.com/github/putty.git
Another warning fix and cosmetic tweakage.
[originally from svn r8665]
This commit is contained in:
Родитель
a83a9cc2a3
Коммит
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче