diff --git a/miniupnpc/addr_is_reserved.c b/miniupnpc/addr_is_reserved.c index 046380e..411b12e 100644 --- a/miniupnpc/addr_is_reserved.c +++ b/miniupnpc/addr_is_reserved.c @@ -62,7 +62,7 @@ int addr_is_reserved(const char * addr_str) return 1; #else /* was : addr_n = inet_addr(addr_str); */ - if (inet_pton(AF_INET, addr_str, &addr_n) < 0) { + if (inet_pton(AF_INET, addr_str, &addr_n) <= 0) { /* error */ return 1; } diff --git a/miniupnpc/minissdpc.c b/miniupnpc/minissdpc.c index 7f68fc5..8d51d6f 100644 --- a/miniupnpc/minissdpc.c +++ b/miniupnpc/minissdpc.c @@ -716,7 +716,7 @@ ssdpDiscoverDevices(const char * const deviceTypes[], #endif #else /* was : mc_if.s_addr = inet_addr(multicastif); */ /* ex: 192.168.x.x */ - if (inet_pton(AF_INET, multicastif, &mc_if.s_addr) < 0) { + if (inet_pton(AF_INET, multicastif, &mc_if.s_addr) <= 0) { mc_if.s_addr = INADDR_NONE; } #endif