diff --git a/usr.bin/bintrans/uudecode.c b/usr.bin/bintrans/uudecode.c --- a/usr.bin/bintrans/uudecode.c +++ b/usr.bin/bintrans/uudecode.c @@ -406,6 +406,8 @@ } } } + if (fflush(outfp) != 0) + err(1, "write error"); switch (get_line(buf, sizeof(buf))) { case 0: return (0); @@ -459,6 +461,8 @@ break; fwrite(outbuf, 1, n, outfp); } + if (fflush(outfp) != 0) + err(1, "write error"); return (checkend(inbuf, "====", "error decoding base64 input stream")); } diff --git a/usr.bin/bintrans/uuencode.c b/usr.bin/bintrans/uuencode.c --- a/usr.bin/bintrans/uuencode.c +++ b/usr.bin/bintrans/uuencode.c @@ -74,7 +74,7 @@ if (w != NULL) columns = arg_to_col(w); base64_encode(); - if (ferror(output)) + if (fflush(output) != 0) errx(1, "write error"); exit(0); } @@ -144,7 +144,7 @@ base64_encode(); else encode(); - if (ferror(output)) + if (fflush(output) != 0) errx(1, "write error"); exit(0); }