[originally from svn r8665]
{
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 :
*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
#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