From: Florian Forster Date: Tue, 18 Nov 2014 16:43:11 +0000 (+0100) Subject: src/oping.c: Exit early if no host could be resolved. X-Git-Tag: liboping-1.8.0~8 X-Git-Url: https://git.tokkee.org/?p=liboping.git;a=commitdiff_plain;h=4c1ab318cd09b77bd8d9118c61d27afdb5933d05 src/oping.c: Exit early if no host could be resolved. Otherwise "noping" would drop the user into an empty ncurses window, which is very confusing, annoying and unexpected. --- diff --git a/src/oping.c b/src/oping.c index 1590bfe..ca92778 100644 --- a/src/oping.c +++ b/src/oping.c @@ -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