202082
--- openssl-0.9.8a/apps/enc.c.orig	2006-07-27 18:37:05.000000000 -0500
202082
+++ openssl-0.9.8a/apps/enc.c	2006-07-27 18:38:30.000000000 -0500
202082
@@ -340,7 +340,7 @@
202082
 			}
202082
 
202082
 		/* It must be large enough for a base64 encoded line */
202082
-		if (n < 80) n=80;
202082
+		if (base64 && n < 80) n=80;
202082
 
202082
 		bsize=(int)n;
202082
 		if (verbose) BIO_printf(bio_err,"bufsize=%d\n",bsize);
202082
@@ -370,7 +370,11 @@
202082
 		}
202082
 
202082
 	if (inf == NULL)
202082
+	        {
202082
+		if (bufsize != NULL)
202082
+			setvbuf(stdin, (char *)NULL, _IONBF, 0);
202082
 		BIO_set_fp(in,stdin,BIO_NOCLOSE);
202082
+	        }
202082
 	else
202082
 		{
202082
 		if (BIO_read_filename(in,inf) <= 0)
202082
@@ -421,6 +425,8 @@
202082
 	if (outf == NULL)
202082
 		{
202082
 		BIO_set_fp(out,stdout,BIO_NOCLOSE);
202082
+		if (bufsize != NULL)
202082
+			setvbuf(stdout, (char *)NULL, _IONBF, 0);
202082
 #ifdef OPENSSL_SYS_VMS
202082
 		{
202082
 		BIO *tmpbio = BIO_new(BIO_f_linebuffer());