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