Reported-by: Pierre-Paul Lavoie <ppl@idios.org>
Signed-off-by: Andy Green <andy@warmcat.com>
struct hostent *host;
struct hostent *host1;
char ip[128];
- char *p;
+ unsigned char *p;
int n;
rip[0] = '\0';
host1 = gethostbyname(host->h_name);
if (host1 == NULL)
return;
- p = (char *)host1;
+ p = (unsigned char *)host1;
n = 0;
while (p != NULL) {
- p = host1->h_addr_list[n++];
+ p = (unsigned char *)host1->h_addr_list[n++];
if (p == NULL)
continue;
if (host1->h_addrtype != AF_INET)
continue;
- sprintf(ip, "%d.%d.%d.%d",
+ sprintf(ip, "%u.%u.%u.%u",
p[0], p[1], p[2], p[3]);
p = NULL;
strncpy(rip, ip, rip_len);