diff options
author | Rob Landley <rob@landley.net> | 2015-01-01 16:59:35 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2015-01-01 16:59:35 -0600 |
commit | 82effc97f9f2d1c258ea50cb11b130753b8ba805 (patch) | |
tree | f6c584d2b1675a91eb1a016977560ff7148c15a1 /toys/pending/arping.c | |
parent | 5f53d130b1eae9041cc88c0ffb89e2b5823da393 (diff) | |
download | toybox-82effc97f9f2d1c258ea50cb11b130753b8ba805.tar.gz |
Switch a lot of strncpy() calls to xstrncpy().
Diffstat (limited to 'toys/pending/arping.c')
-rw-r--r-- | toys/pending/arping.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |