From 82effc97f9f2d1c258ea50cb11b130753b8ba805 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 1 Jan 2015 16:59:35 -0600 Subject: Switch a lot of strncpy() calls to xstrncpy(). --- toys/pending/arping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toys/pending/arping.c') diff --git a/toys/pending/arping.c b/toys/pending/arping.c index bc1fa5e1..3e522bdf 100644 --- a/toys/pending/arping.c +++ b/toys/pending/arping.c @@ -63,7 +63,7 @@ static void get_interface(char *interface, int *ifindex, uint32_t *oip, int fd = xsocket(AF_INET, SOCK_RAW, IPPROTO_RAW); req.ifr_addr.sa_family = AF_INET; - strncpy(req.ifr_name, interface, IFNAMSIZ); + xstrncpy(req.ifr_name, interface, IFNAMSIZ); req.ifr_name[IFNAMSIZ-1] = '\0'; xioctl(fd, SIOCGIFFLAGS, &req); @@ -215,7 +215,7 @@ void arping_main(void) TT.sockfd = xsocket(AF_PACKET, SOCK_DGRAM, 0); memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, TT.iface, IFNAMSIZ); + xstrncpy(ifr.ifr_name, TT.iface, IFNAMSIZ); get_interface(TT.iface, &if_index, NULL, NULL); src_pk.sll_ifindex = if_index; -- cgit v1.2.3