fix some strncpy warnings when build with gcc8

This commit is contained in:
GetAway
2019-06-18 19:15:58 +02:00
parent 07f0a015ab
commit 305af3116e
3 changed files with 9 additions and 9 deletions

View File

@@ -46,7 +46,7 @@ static void device_up(std::string dev)
memset(&ifr, 0, sizeof ifr);
strncpy(ifr.ifr_name, dev.c_str(), IFNAMSIZ);
strncpy(ifr.ifr_name, dev.c_str(), IFNAMSIZ-1);
if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0)
perror("SIOCGIFFLAGS");