Bugfix/win32 build warnings (#936)
* Changed win32 port of localtime to use secure OS API functions when compiled with MSVC * Changed all the sprintf to use snprintf instead in BSC tests to ensure null string endings.
This commit is contained in:
@@ -475,7 +475,7 @@ get_local_ifr_ioctl(const char *ifname, struct ifreq *ifr, int request)
|
||||
int fd;
|
||||
int rv; /* return value */
|
||||
|
||||
strncpy(ifr->ifr_name, ifname, sizeof(ifr->ifr_name) - 1);
|
||||
snprintf(ifr->ifr_name, sizeof(ifr->ifr_name), "%s", ifname);
|
||||
ifr->ifr_name[sizeof(ifr->ifr_name) - 1] = 0;
|
||||
|
||||
fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP);
|
||||
|
||||
Reference in New Issue
Block a user