diff options
author | Pauli <pauli@openssl.org> | 2021-05-07 14:19:06 +1000 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-05-08 22:15:56 +1000 |
commit | 29f5727b83c4ec26ff8e183c1b0dc707a3719588 (patch) | |
tree | 8cbd94fe2ffd73f3f764932e3339ad908f506339 /apps | |
parent | 68f3fb051487581e3a424235b3d4f651cf558493 (diff) |
apps/mac: avoid need for two ^D when using stdin from a terminal
Fixes #13246
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15189)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/mac.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/mac.c b/apps/mac.c index dccbb68117..b9610f3a18 100644 --- a/apps/mac.c +++ b/apps/mac.c @@ -150,10 +150,11 @@ opthelp: goto err; } - for (;;) { + while (BIO_pending(in) || !BIO_eof(in)) { i = BIO_read(in, (char *)buf, BUFSIZE); if (i < 0) { BIO_printf(bio_err, "Read Error in '%s'\n", infile); + ERR_print_errors(bio_err); goto err; } if (i == 0) |