]> granicus.if.org Git - sudo/commitdiff
Move the n == 0 check for the non-getifaddrs cas
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 14 Mar 2003 15:35:54 +0000 (15:35 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 14 Mar 2003 15:35:54 +0000 (15:35 +0000)
interfaces.c

index 43c7bf9c59cfb7b5a0537fd69f6e29bce36f124e..5c338f91774eb54a089cdaac17ed66b15b3c0b64 100644 (file)
@@ -218,11 +218,10 @@ load_interfaces()
            break;
        len += BUFSIZ;
     }
-    if (n == 0)
-       return;
 
     /* Allocate space for the maximum number of interfaces that could exist. */
-    n = ifconf->ifc_len / sizeof(struct ifreq);
+    if ((n = ifconf->ifc_len / sizeof(struct ifreq)) == 0)
+       return;
     interfaces = (struct interface *) emalloc2(n, sizeof(struct interface));
 
     /* For each interface, store the ip address and netmask. */