diff options
author | 2006-10-14 18:50:32 +0000 | |
---|---|---|
committer | 2006-10-14 18:50:32 +0000 | |
commit | eac8f7173476848e35c362c5cce6760dd134be4f (patch) | |
tree | 53da6f0fb1dcef67b41b37dc535719a0a90a656a /lib/libc/stdio | |
parent | No need to tape about tape creation on armish. (diff) | |
download | wireguard-openbsd-eac8f7173476848e35c362c5cce6760dd134be4f.tar.xz wireguard-openbsd-eac8f7173476848e35c362c5cce6760dd134be4f.zip |
Make fgets description much clearer with respect to its exact behavior.
OK and input from deraadt, jmc, millert.
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r-- | lib/libc/stdio/fgets.3 | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/libc/stdio/fgets.3 b/lib/libc/stdio/fgets.3 index 3ba2aacbbab..62f6fb8e7b4 100644 --- a/lib/libc/stdio/fgets.3 +++ b/lib/libc/stdio/fgets.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: fgets.3,v 1.21 2005/07/26 03:30:25 jaredy Exp $ +.\" $OpenBSD: fgets.3,v 1.22 2006/10/14 18:50:32 cloder Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -47,18 +47,20 @@ .Sh DESCRIPTION The .Fn fgets -function reads at most one less than the number of characters specified by -.Ar size -from the given +function reads at most +.Ar size Ns \-1 +characters from the given .Fa stream and stores them in the string .Fa str . Reading stops when a newline character is found, at end-of-file, or on error. The newline, if any, is retained. -In any case, a -.Ql \e0 -character is appended to end the string. +The string will be NUL-terminated if +.Fn fgets +suceeds; otherwise the contents of +.Fa str +are undefined. .Pp The .Fn gets |