xgethostbyname: more readable
authorDenis Vlasenko <vda.linux@googlemail.com>
Tue, 21 Nov 2006 20:35:22 +0000 (20:35 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Tue, 21 Nov 2006 20:35:22 +0000 (20:35 -0000)
libbb/xgethostbyname.c

index 0bbe18da2e74f6cc64456a1dea4f2b88bd6ee5e4..c3158c3394a2b0d7e962f200c5503ec71d85310e 100644 (file)
 #include <netdb.h>
 #include "libbb.h"
 
-
 struct hostent *xgethostbyname(const char *name)
 {
-       struct hostent *retval;
-
-       if ((retval = gethostbyname(name)) == NULL)
+       struct hostent *retval = gethostbyname(name);
+       if (!retval)
                bb_herror_msg_and_die("%s", name);
-
        return retval;
 }