Code

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 1590bfe54773c2ec8ec5d60ee85467a38ebe9ec3..ca9277895dfc9486527feabcca65b9e8706ecc6a 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