diff --git a/src/core/wee-network.c b/src/core/wee-network.c index 3e7d4e2cf..5c402b1ea 100644 --- a/src/core/wee-network.c +++ b/src/core/wee-network.c @@ -337,11 +337,11 @@ network_is_ip_address (const char *address) return 0; /* valid IPv4? */ - if (inet_pton (AF_INET, address, &server_addr.sin_addr)) + if (inet_pton (AF_INET, address, &server_addr.sin_addr) == 1) return 1; /* valid IPv6? */ - if (inet_pton (AF_INET6, address, &server_addr6.sin6_addr)) + if (inet_pton (AF_INET6, address, &server_addr6.sin6_addr) == 1) return 1; /* not a valid IP address */ diff --git a/src/plugins/relay/relay-server.c b/src/plugins/relay/relay-server.c index 13889ea64..daceaa167 100644 --- a/src/plugins/relay/relay-server.c +++ b/src/plugins/relay/relay-server.c @@ -512,7 +512,7 @@ relay_server_create_socket (struct t_relay_server *server) server_addr6.sin6_addr = in6addr_any; if (bind_address && bind_address[0]) { - if (!inet_pton (domain, bind_address, &server_addr6.sin6_addr)) + if (inet_pton (domain, bind_address, &server_addr6.sin6_addr) != 1) { weechat_printf (NULL, /* TRANSLATORS: second "%s" is "IPv4" or "IPv6" */ @@ -534,7 +534,7 @@ relay_server_create_socket (struct t_relay_server *server) server_addr.sin_addr.s_addr = INADDR_ANY; if (bind_address && bind_address[0]) { - if (!inet_pton (domain, bind_address, &server_addr.sin_addr)) + if (inet_pton (domain, bind_address, &server_addr.sin_addr) != 1) { weechat_printf (NULL, /* TRANSLATORS: second "%s" is "IPv4" or "IPv6" */