diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2006-09-22 17:14:22 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2006-09-22 17:14:22 +0000 |
commit | 347ed3b93c560af5ab6582425c250f486bf685bf (patch) | |
tree | aaafda96f345d40597797b8b5b9329e602fec547 | |
parent | 5b73c3609bffc86f4eb0852da44a0c20a957db97 (diff) |
Buffer size handling fix for enc.
PR:1374
-rw-r--r-- | apps/enc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/enc.c b/apps/enc.c index ea948f8d10..3e3e8eb4b8 100644 --- a/apps/enc.c +++ b/apps/enc.c @@ -340,7 +340,7 @@ bad: } /* It must be large enough for a base64 encoded line */ - if (n < 80) n=80; + if (base64 && n < 80) n=80; bsize=(int)n; if (verbose) BIO_printf(bio_err,"bufsize=%d\n",bsize); @@ -370,7 +370,11 @@ bad: } if (inf == NULL) + { + if (bufsize != NULL) + setvbuf(stdin, (char *)NULL, _IONBF, 0); BIO_set_fp(in,stdin,BIO_NOCLOSE); + } else { if (BIO_read_filename(in,inf) <= 0) @@ -421,6 +425,8 @@ bad: if (outf == NULL) { BIO_set_fp(out,stdout,BIO_NOCLOSE); + if (bufsize != NULL) + setvbuf(stdout, (char *)NULL, _IONBF, 0); #ifdef OPENSSL_SYS_VMS { BIO *tmpbio = BIO_new(BIO_f_linebuffer()); |