From 55c5e520bf6b0359e983d6a3de875cd1ac3bfe70 Mon Sep 17 00:00:00 2001 From: lzmths Date: Sun, 13 Dec 2015 20:27:17 -0300 Subject: [PATCH] Refactoring conditional directives that break parts of statements. --- dep/src/enet/unix.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dep/src/enet/unix.c b/dep/src/enet/unix.c index 6230350b..43622303 100644 --- a/dep/src/enet/unix.c +++ b/dep/src/enet/unix.c @@ -71,6 +71,7 @@ int enet_address_set_host (ENetAddress * address, const char * name) { struct hostent * hostEntry = NULL; + int convert_test; #ifdef HAS_GETHOSTBYNAME_R struct hostent hostData; char buffer [2048]; @@ -89,10 +90,11 @@ enet_address_set_host (ENetAddress * address, const char * name) hostEntry -> h_addrtype != AF_INET) { #ifdef HAS_INET_PTON - if (! inet_pton (AF_INET, name, & address -> host)) + convert_test = ! inet_pton (AF_INET, name, & address -> host); #else - if (! inet_aton (name, (struct in_addr *) & address -> host)) + convert_test = ! inet_aton (name, (struct in_addr *) & address -> host); #endif + if (convert_test) return -1; return 0; }