ap: Fix an inet_aton error check

inet_aton returns 0 on error, not a negative number.
This commit is contained in:
Andrew Zaborowski 2021-02-26 17:17:23 +01:00 committed by Denis Kenzior
parent fd934aa39e
commit cdb2c2b3e3
1 changed files with 1 additions and 1 deletions

View File

@ -213,7 +213,7 @@ static const char *broadcast_from_ip(const char *ip)
struct in_addr ia;
uint32_t bcast;
if (inet_aton(ip, &ia) < 0)
if (inet_aton(ip, &ia) != 1)
return NULL;
bcast = ntohl(ia.s_addr);