diff options
author | 2014-11-04 20:06:29 +0000 | |
---|---|---|
committer | 2014-11-04 20:06:29 +0000 | |
commit | d44c6d00412024e83ebb7cc05edf324cf99b9119 (patch) | |
tree | 92694a0b5f5ee4dc5b2f3f8d17b7b330dfb78a2d /lib/libc/stdio | |
parent | panic when a sensordev gets installed twice, instead of blowing up amazingly (diff) | |
download | wireguard-openbsd-d44c6d00412024e83ebb7cc05edf324cf99b9119.tar.xz wireguard-openbsd-d44c6d00412024e83ebb7cc05edf324cf99b9119.zip |
explicitly clarify that reading also stops after size-1 bytes
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r-- | lib/libc/stdio/fgets.3 | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/stdio/fgets.3 b/lib/libc/stdio/fgets.3 index 1e956610ea2..8b50c37ef90 100644 --- a/lib/libc/stdio/fgets.3 +++ b/lib/libc/stdio/fgets.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: fgets.3,v 1.32 2014/03/23 23:15:58 tedu Exp $ +.\" $OpenBSD: fgets.3,v 1.33 2014/11/04 20:06:29 tedu Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -31,7 +31,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: March 23 2014 $ +.Dd $Mdocdate: November 4 2014 $ .Dt FGETS 3 .Os .Sh NAME @@ -51,7 +51,9 @@ characters from the given and stores them in the string .Fa str . Reading stops when a newline character is found, -at end-of-file, or on error. +at end-of-file, on error, or after +.Ar size Ns \-1 +bytes are read. The newline, if any, is retained. The string will be NUL-terminated if .Fn fgets |