aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/arping.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-01-01 16:59:35 -0600
committerRob Landley <rob@landley.net>2015-01-01 16:59:35 -0600
commit82effc97f9f2d1c258ea50cb11b130753b8ba805 (patch)
treef6c584d2b1675a91eb1a016977560ff7148c15a1 /toys/pending/arping.c
parent5f53d130b1eae9041cc88c0ffb89e2b5823da393 (diff)
downloadtoybox-82effc97f9f2d1c258ea50cb11b130753b8ba805.tar.gz
Switch a lot of strncpy() calls to xstrncpy().
Diffstat (limited to 'toys/pending/arping.c')
-rw-r--r--toys/pending/arping.c4
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;