diff options
Diffstat (limited to 'networking/arping.c')
-rw-r--r-- | networking/arping.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/networking/arping.c b/networking/arping.c index aba32b869..e4429973b 100644 --- a/networking/arping.c +++ b/networking/arping.c | |||
@@ -286,7 +286,7 @@ int arping_main(int argc UNUSED_PARAM, char **argv) | |||
286 | struct ifreq ifr; | 286 | struct ifreq ifr; |
287 | 287 | ||
288 | memset(&ifr, 0, sizeof(ifr)); | 288 | memset(&ifr, 0, sizeof(ifr)); |
289 | strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name) - 1); | 289 | strncpy_IFNAMSIZ(ifr.ifr_name, device); |
290 | /* We use ifr.ifr_name in error msg so that problem | 290 | /* We use ifr.ifr_name in error msg so that problem |
291 | * with truncated name will be visible */ | 291 | * with truncated name will be visible */ |
292 | ioctl_or_perror_and_die(sock_fd, SIOCGIFINDEX, &ifr, err_str, "not found"); | 292 | ioctl_or_perror_and_die(sock_fd, SIOCGIFINDEX, &ifr, err_str, "not found"); |