summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdio/fgets.36
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/stdio/fgets.3 b/lib/libc/stdio/fgets.3
index 14c5885c684..39da3b65258 100644
--- a/lib/libc/stdio/fgets.3
+++ b/lib/libc/stdio/fgets.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: fgets.3,v 1.11 2000/12/24 00:30:58 aaron Exp $
+.\" $OpenBSD: fgets.3,v 1.12 2002/03/05 16:53:59 millert Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -127,8 +127,8 @@ string is too long if it does not contain a newline:
.Bd -literal
char buf[1024], *p;
- while (fgets(buf, sizeof(buf), fp)) {
- if (!(p = strchr(buf, '\en'))) {
+ while (fgets(buf, sizeof(buf), fp) != NULL) {
+ if ((p = strchr(buf, '\en')) != NULL) {
fprintf(stderr, "input line too long.\en");
exit(1);
}