Compile fix for WIN32

llvm-svn: 226301
This commit is contained in:
Vince Harron 2015-01-16 19:07:30 +00:00
parent baa15585ca
commit ded5ff6fce
1 changed files with 9 additions and 7 deletions

View File

@ -41,11 +41,13 @@ const char* inet_ntop(int af, const void * src,
{
case AF_INET:
{
const char* formatted = inet_ntoa(*static_cast<const in_addr*>(src));
if (formatted && strlen(formatted) < size)
{
strncpy(dst, formatted, size);
return dst;
const char* formatted = inet_ntoa(*static_cast<const in_addr*>(src));
if (formatted && strlen(formatted) < size)
{
strncpy(dst, formatted, size);
return dst;
}
}
return nullptr;
case AF_INET6:
@ -57,7 +59,7 @@ const char* inet_ntop(int af, const void * src,
ntohs(src16[0]), ntohs(src16[1]), ntohs(src16[2]), ntohs(src16[3]),
ntohs(src16[4]), ntohs(src16[5]), ntohs(src16[6]), ntohs(src16[7])
);
if (full_size < size)
if (full_size < static_cast<int>(size))
{
strncpy(dst,tmp,size);
return dst;
@ -65,9 +67,9 @@ const char* inet_ntop(int af, const void * src,
return nullptr;
}
}
return nullptr;
}
return nullptr;
}
#endif