1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

Glen Nakamura made his fix look even better!

This commit is contained in:
Daniel Stenberg 2002-06-26 15:39:23 +00:00
parent a9c0302454
commit 7f8ad34ba2

View File

@ -530,8 +530,8 @@ Curl_addrinfo *Curl_getaddrinfo(struct SessionHandle *data,
struct hostent hostentry; struct hostent hostentry;
char *h_addr_list[2]; char *h_addr_list[2];
struct in_addr addrentry; struct in_addr addrentry;
char h_name[1]; char h_name[128];
} *buf = (struct namebuf *)malloc(sizeof(struct namebuf)+128); } *buf = (struct namebuf *)malloc(sizeof(struct namebuf));
if(!buf) if(!buf)
return NULL; /* major failure */ return NULL; /* major failure */
*bufp = (char *)buf; *bufp = (char *)buf;
@ -545,8 +545,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct SessionHandle *data,
h->h_addrtype = AF_INET; h->h_addrtype = AF_INET;
h->h_length = sizeof(*addrentry); h->h_length = sizeof(*addrentry);
h->h_name = &buf->h_name[0]; h->h_name = &buf->h_name[0];
MakeIP(ntohl(in), h->h_name, MakeIP(ntohl(in), h->h_name, sizeof(buf->h_name));
sizeof(struct namebuf)+128 - (long)(h->h_name) + (long)buf);
} }
#if defined(HAVE_GETHOSTBYNAME_R) #if defined(HAVE_GETHOSTBYNAME_R)
else { else {