Correct wrong comparison in example.
This commit is contained in:
parent
7de36862a8
commit
a32f58ffa9
|
@ -1,4 +1,4 @@
|
||||||
.\" $NetBSD: fgets.3,v 1.13 2002/07/10 14:37:16 yamt Exp $
|
.\" $NetBSD: fgets.3,v 1.14 2002/07/21 19:04:03 mjl Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 1990, 1991, 1993
|
.\" Copyright (c) 1990, 1991, 1993
|
||||||
.\" The Regents of the University of California. All rights reserved.
|
.\" The Regents of the University of California. All rights reserved.
|
||||||
|
@ -146,7 +146,7 @@ string is too long if it does not contain a newline:
|
||||||
char buf[1024], *p;
|
char buf[1024], *p;
|
||||||
|
|
||||||
while (fgets(buf, sizeof(buf), fp) != NULL) {
|
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");
|
fprintf(stderr, "input line too long.\en");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue