1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-29 04:54:28 +01:00

fix ip_to_int function on windows

This commit is contained in:
zhiweicai
2014-12-16 21:32:59 -05:00
parent ae135bb035
commit 8bf3b1af45
2 changed files with 4 additions and 2 deletions

View File

@@ -81,7 +81,7 @@ uint32_t IPv4Address::ip_to_int(const char* ip) {
#ifdef WIN32
in_addr addr;
if(InetPtonA(AF_INET, ip, &addr)) {
return addr.s_addr;
return Endian::be_to_host(addr.s_addr);
}
else {
throw std::runtime_error("Invalid ip address");