diff -ru sbin/ping.orig/ping.c sbin/ping/ping.c --- sbin/ping.orig/ping.c 2003-09-28 11:39:20.000000000 -0300 +++ sbin/ping/ping.c 2004-10-25 22:21:47.000000000 -0200 @@ -403,8 +403,7 @@ errx(1, "gethostbyname2: illegal address"); memcpy(&sin.sin_addr, hp->h_addr_list[0], sizeof(sin.sin_addr)); - (void)strncpy(snamebuf, hp->h_name, - sizeof(snamebuf) - 1); + strlcpy(snamebuf, hp->h_name, sizeof(snamebuf)); snamebuf[sizeof(snamebuf) - 1] = '\0'; shostname = snamebuf; } @@ -427,7 +426,7 @@ if (hp->h_length > sizeof(to->sin_addr)) errx(1, "gethostbyname2 returned an illegal address"); memcpy(&to->sin_addr, hp->h_addr_list[0], sizeof to->sin_addr); - (void)strncpy(hnamebuf, hp->h_name, sizeof(hnamebuf) - 1); + strlcpy(hnamebuf, hp->h_name, sizeof(hnamebuf)); hnamebuf[sizeof(hnamebuf) - 1] = '\0'; hostname = hnamebuf; }