nwrap: slightly clean flow by removing an else branch in nwrap_getaddrinfo
authorMichael Adam <obnox@samba.org>
Sun, 8 Nov 2015 23:55:00 +0000 (00:55 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 11 Nov 2015 09:51:21 +0000 (10:51 +0100)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
src/nss_wrapper.c

index e1edd7e15f11bfcf2870d7a6e67dcacca077e360..988eb1d4f5d2d1262c9cc1c5a0a7ca230809b44a 100644 (file)
@@ -5102,11 +5102,10 @@ static int nwrap_getaddrinfo(const char *node,
                }
 
                s = getservbyname(service, proto);
-               if (s != NULL) {
-                       port = ntohs(s->s_port);
-               } else {
+               if (s == NULL) {
                        return EAI_NONAME;
                }
+               port = ntohs(s->s_port);
        }
 
 valid_port: