summaryrefslogtreecommitdiff
path: root/src/yes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/yes.c')
-rw-r--r--src/yes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/yes.c b/src/yes.c
index 31424cf20..1d2c612c9 100644
--- a/src/yes.c
+++ b/src/yes.c
@@ -121,6 +121,7 @@ main (int argc, char **argv)
if ((pbuf - buf) && fwrite (buf, pbuf - buf, 1, stdout) != 1)
{
error (0, errno, _("standard output"));
+ clearerr (stdout);
return EXIT_FAILURE;
}
for (j = i; j < argc; j++)
@@ -128,6 +129,7 @@ main (int argc, char **argv)
|| putchar (j == argc - 1 ? '\n' : ' ') == EOF)
{
error (0, errno, _("standard output"));
+ clearerr (stdout);
return EXIT_FAILURE;
}
}