summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/fgets.3
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-11-04 20:06:29 +0000
committertedu <tedu@openbsd.org>2014-11-04 20:06:29 +0000
commitd44c6d00412024e83ebb7cc05edf324cf99b9119 (patch)
tree92694a0b5f5ee4dc5b2f3f8d17b7b330dfb78a2d /lib/libc/stdio/fgets.3
parentpanic when a sensordev gets installed twice, instead of blowing up amazingly (diff)
downloadwireguard-openbsd-d44c6d00412024e83ebb7cc05edf324cf99b9119.tar.xz
wireguard-openbsd-d44c6d00412024e83ebb7cc05edf324cf99b9119.zip
explicitly clarify that reading also stops after size-1 bytes
Diffstat (limited to 'lib/libc/stdio/fgets.3')
-rw-r--r--lib/libc/stdio/fgets.38
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