From b725f5114fba15c7fdecc52a947ae8e11fe22663 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Sun, 10 Mar 2019 19:23:58 +0100 Subject: [PATCH] connecthostport.c: code simplification --- miniupnpc/connecthostport.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/miniupnpc/connecthostport.c b/miniupnpc/connecthostport.c index 63e5ee0..6d58e6d 100644 --- a/miniupnpc/connecthostport.c +++ b/miniupnpc/connecthostport.c @@ -260,14 +260,8 @@ SOCKET connecthostport(const char * host, unsigned short port, } } #endif /* #ifdef MINIUPNPC_IGNORE_EINTR */ - if(n < 0) - { - continue; - } - else - { + if(n >= 0) /* connect() was successful */ break; - } } freeaddrinfo(ai); if(ISINVALID(s))