diff options
author | 2002-07-20 18:30:23 +0000 | |
---|---|---|
committer | 2002-07-20 18:30:23 +0000 | |
commit | 6ee14528632042f6f223c90095872b417e5c506d (patch) | |
tree | adb5dae77e1c7b2f4d12fcd52c341b53ff9b7359 /lib/libc | |
parent | abort on setusercontext failure; millert ok (diff) | |
download | wireguard-openbsd-6ee14528632042f6f223c90095872b417e5c506d.tar.xz wireguard-openbsd-6ee14528632042f6f223c90095872b417e5c506d.zip |
correct check for strchr() failure in EXAMPLE; from pinskia@physics.uc.edu
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/stdio/fgets.3 | 4 |
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); } |