src/oping.c: Exit early if no host could be resolved.
authorFlorian Forster <ff@octo.it>
Tue, 18 Nov 2014 16:43:11 +0000 (17:43 +0100)
committerFlorian Forster <ff@octo.it>
Tue, 18 Nov 2014 16:43:11 +0000 (17:43 +0100)
Otherwise "noping" would drop the user into an empty ncurses window,
which is very confusing, annoying and unexpected.

src/oping.c

index 1590bfe..ca92778 100644 (file)
@@ -1759,6 +1759,9 @@ int main (int argc, char **argv) /* {{{ */
                exit (EXIT_FAILURE);
        }
 
+       if (host_num == 0)
+               exit (EXIT_FAILURE);
+
 #if _POSIX_SAVED_IDS
        saved_set_uid = (uid_t) -1;
 #endif