From 6fc51db156b0f0dc533941bb24aa4f24f07f2124 Mon Sep 17 00:00:00 2001 From: pirate sans barbe Date: Wed, 3 Mar 2021 08:33:55 -1000 Subject: [PATCH] bail when stdin feof is reached and more lines are to be printed --- hydra.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hydra.c b/hydra.c index e6cc1e3..24a3a3f 100644 --- a/hydra.c +++ b/hydra.c @@ -254,10 +254,7 @@ char *read_line_stdin() { do { c = getc(stdin); if(feof(stdin)) - { - fprintf(stderr, "eof\n"); - break; - } + return NULL; strncpy(&word[i], &c, 1); i++; } while(c != '\n'); @@ -620,8 +617,7 @@ void help_bfg() { " just add their real representation.\n" " -y disable the use of the above letters as placeholders\n\n" " -x +LINES\n\n" - " LINES is the numer of lines read from standard input,\n" - " you must not set it above what stdin is going to produce.\n" + " LINES is the numer of lines read from standard input\n\n" "Examples:\n" " -x 3:5:a generate passwords from length 3 to 5 with all " "lowercase letters\n"