hurd: Fix missing trailing NUL in __if_nametoindex

* sysdeps/mach/hurd/if_index.c (__if_nametoindex): Pass the whole buffer
size to strncpy.
This commit is contained in:
Samuel Thibault 2018-04-04 00:01:19 +02:00
parent 92846492dc
commit cd104f4ff4

View file

@ -43,7 +43,7 @@ __if_nametoindex (const char *ifname)
return 0;
}
strncpy (ifr.ifr_name, ifname, IFNAMESIZ - 1);
strncpy (ifr.ifr_name, ifname, IFNAMESIZ);
if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
{
int saved_errno = errno;