summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorssouhlal <ssouhlal@FreeBSD.org>2004-12-15 06:24:57 +0000
committerssouhlal <ssouhlal@FreeBSD.org>2004-12-15 06:24:57 +0000
commitbe55a34f7f674cbec52d1e8cbdebdacaa6546bc4 (patch)
treeeed7f2ca09418f1c98e6c817ca54b962cb3f624a
parent5ec8391060c923f14f17e4c273b2932c53698a13 (diff)
downloadFreeBSD-src-be55a34f7f674cbec52d1e8cbdebdacaa6546bc4.zip
FreeBSD-src-be55a34f7f674cbec52d1e8cbdebdacaa6546bc4.tar.gz
If ferror is true, we must reset the error indicator.
Submitted by: Liam J. Foy <liamfoy@sepulcrum.org> Approved by: grehan (mentor)
-rw-r--r--usr.bin/rev/rev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.bin/rev/rev.c b/usr.bin/rev/rev.c
index 87c8587..67080fb 100644
--- a/usr.bin/rev/rev.c
+++ b/usr.bin/rev/rev.c
@@ -103,6 +103,7 @@ main(int argc, char *argv[])
}
if (ferror(fp)) {
warn("%s", filename);
+ clearerr(fp);
rval = 1;
}
(void)fclose(fp);
OpenPOWER on IntegriCloud