summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/fgets.3
diff options
context:
space:
mode:
authorPeter Valchev <pvalchev@cvs.openbsd.org>2002-07-20 18:30:24 +0000
committerPeter Valchev <pvalchev@cvs.openbsd.org>2002-07-20 18:30:24 +0000
commit85090b3e23f439c1a585ac934a495b09835ad246 (patch)
tree1421332142044ccf740a5038e781038a3f1ea2ee /lib/libc/stdio/fgets.3
parentb62a1520d13ccfd14026738ac1d06c963fdd2404 (diff)
correct check for strchr() failure in EXAMPLE; from pinskia@physics.uc.edu
Diffstat (limited to 'lib/libc/stdio/fgets.3')
-rw-r--r--lib/libc/stdio/fgets.34
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdio/fgets.3 b/lib/libc/stdio/fgets.3
index 9ca36d0859f..2937cea99e3 100644
--- a/lib/libc/stdio/fgets.3
+++ b/lib/libc/stdio/fgets.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: fgets.3,v 1.13 2002/04/05 01:44:38 aaron Exp $
+.\" $OpenBSD: fgets.3,v 1.14 2002/07/20 18:30:23 pvalchev Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -128,7 +128,7 @@ string is too long if it does not contain a newline:
char buf[1024], *p;
while (fgets(buf, sizeof(buf), fp) != NULL) {
- if ((p = strchr(buf, '\en')) != NULL) {
+ if ((p = strchr(buf, '\en')) == NULL) {
fprintf(stderr, "input line too long.\en");
exit(1);
}