aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/pending/route.c')
-rw-r--r--toys/pending/route.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/pending/route.c b/toys/pending/route.c
index 163ce6b3..ac1bbef5 100644
--- a/toys/pending/route.c
+++ b/toys/pending/route.c
@@ -411,7 +411,7 @@ static void setroute_inet6(char **argv)
if (dev_name) {
char ifre_buf[sizeof(struct ifreq)] = {0,};
struct ifreq *ifre = (struct ifreq*)ifre_buf;
- strncpy(ifre->ifr_name, dev_name, IFNAMSIZ-1);
+ xstrncpy(ifre->ifr_name, dev_name, IFNAMSIZ);
xioctl(sockfd, SIOGIFINDEX, ifre);
rt.rtmsg_ifindex = ifre->ifr_ifindex;
}