From: Nicolas Williams Date: Wed, 24 Dec 2014 22:48:39 +0000 (-0600) Subject: Fix infinite loop in read_more() (fix #656) X-Git-Tag: jq-1.5rc1~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e1fd8cf4da04faf1170739923a099e74da61231;p=jq Fix infinite loop in read_more() (fix #656) --- diff --git a/main.c b/main.c index 0d32cb0..2d022bb 100644 --- a/main.c +++ b/main.c @@ -154,7 +154,7 @@ const char** input_filenames = NULL; int ninput_files; int next_input_idx; static int read_more(char* buf, size_t size) { - while (!current_input || feof(current_input)) { + if (!current_input || feof(current_input)) { if (current_input) { if (current_input == stdin) { clearerr(stdin); // perhaps we can read again; anyways, we don't fclose(stdin)