Add some type casts so it builds on VS2015 with a certain SDK

This commit is contained in:
Ludvig Strigeus 2018-08-12 13:04:44 +02:00
parent 3f1b435b4e
commit e116360538
2 changed files with 3 additions and 2 deletions

View file

@ -987,7 +987,7 @@ DWORD SetMetricOnNetworkAdapter(NET_LUID *InterfaceLuid, ADDRESS_FAMILY family,
static const char *PrintIPV6(const uint8 new_address[16]) {
sockaddr_in6 sin6 = {0};
static char buf[100];
if (!inet_ntop(PF_INET6, new_address, buf, 100))
if (!inet_ntop(PF_INET6, (void*)new_address, buf, 100))
memcpy(buf, "unknown", 8);
return buf;
}

View file

@ -25,7 +25,8 @@
#endif
const char *print_ip_prefix(char buf[kSizeOfAddress], int family, const void *ip, int prefixlen) {
if (!inet_ntop(family, ip, buf, kSizeOfAddress - 8)) {
// cast to void* to work on VS2015
if (!inet_ntop(family, (void*)ip, buf, kSizeOfAddress - 8)) {
memcpy(buf, "unknown", 8);
}
if (prefixlen >= 0)