Bug 7360: Fix two calls to snprintf()

master
Yves-Alexis Perez 2012-01-07 15:56:26 +01:00 committed by Mike Massonnet
parent e683d98fea
commit 6751c3da27
1 changed files with 2 additions and 2 deletions

View File

@ -194,7 +194,7 @@ int get_interface_up(netdata* data)
return FALSE; return FALSE;
} }
snprintf(ifr.ifr_name, IF_NAMESIZE, data->ifdata.if_name); snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", data->ifdata.if_name);
if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) != 0) if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) != 0)
{ {
PRINT_DBG("Error in ioctl(sockfd): %s", strerror(errno)); PRINT_DBG("Error in ioctl(sockfd): %s", strerror(errno));
@ -231,7 +231,7 @@ char* get_ip_address(netdata* data)
return NULL; return NULL;
} }
snprintf(ifr.ifr_name, IF_NAMESIZE, data->ifdata.if_name); snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", data->ifdata.if_name);
if (ioctl(sockfd, SIOCGIFADDR, &ifr) != 0) if (ioctl(sockfd, SIOCGIFADDR, &ifr) != 0)
{ {
if (errno != EADDRNOTAVAIL) if (errno != EADDRNOTAVAIL)