mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-23 03:06:48 +00:00
traceroute: Silence compiler warning
Silence the warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination?" by using strlcpy() and the size of the destination (device). No functional change intended. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/901
This commit is contained in:
parent
7414d14bd5
commit
af87ba6522
|
@ -141,8 +141,7 @@ ifaddrlist(register struct ifaddrlist **ipaddrp, register char *errbuf)
|
|||
continue;
|
||||
|
||||
|
||||
(void)strncpy(device, ifr.ifr_name, sizeof(ifr.ifr_name));
|
||||
device[sizeof(device) - 1] = '\0';
|
||||
(void)strlcpy(device, ifr.ifr_name, sizeof(device));
|
||||
#ifdef sun
|
||||
/* Ignore sun virtual interfaces */
|
||||
if (strchr(device, ':') != NULL)
|
||||
|
|
Loading…
Reference in a new issue