Implement suggestion from Adam Slattery, (don't default to killing closing bug #1190.
[oweals/busybox.git] / nc.c
diff --git a/nc.c b/nc.c
index b58bd6a12f38219357e1df67430cdc5f91cf0698..5335872e5a7ca50b4e3fa5b410fbffb333d459b9 100644 (file)
--- a/nc.c
+++ b/nc.c
@@ -91,8 +91,7 @@ int nc_main(int argc, char **argv)
                close(sfd);
                sfd = tmpfd;
        } else {
-               if ((hostinfo = gethostbyname(argv[optind])) == NULL)
-                       error_msg_and_die("cannot resolve %s\n", argv[optind]);
+               hostinfo = xgethostbyname(argv[optind]);
 
                address.sin_addr = *(struct in_addr *) *hostinfo->h_addr_list;
                address.sin_port = htons(atoi(argv[optind+1]));