getaddrinfo error codes can also be positive.

This commit is contained in:
aliaspider 2017-05-28 12:46:39 +01:00
parent f589c50043
commit b49d2a87ab
2 changed files with 3 additions and 3 deletions

View File

@ -411,7 +411,7 @@ bool udp_send_packet(const char *host,
snprintf(port_buf, sizeof(port_buf), "%hu", (unsigned short)port);
if (getaddrinfo_retro(host, port_buf, &hints, &res) < 0)
if (getaddrinfo_retro(host, port_buf, &hints, &res) != 0)
return false;
/* Send to all possible targets.

View File

@ -131,14 +131,14 @@ static bool init_tcp_socket(netplay_t *netplay, void *direct_host,
hints.ai_flags = AI_PASSIVE;
snprintf(port_buf, sizeof(port_buf), "%hu", (unsigned short)port);
if (getaddrinfo_retro(server, port_buf, &hints, &res) < 0)
if (getaddrinfo_retro(server, port_buf, &hints, &res) != 0)
{
#ifdef HAVE_INET6
if (!server)
{
/* Didn't work with IPv6, try wildcard */
hints.ai_family = 0;
if (getaddrinfo_retro(server, port_buf, &hints, &res) < 0)
if (getaddrinfo_retro(server, port_buf, &hints, &res) != 0)
return false;
}
else