1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

Document the fact that the printf() family of functions return negative

values (EOF in our case) on error, and some of the possible errno values
in an Errors section.

PR:		39257
This commit is contained in:
Tim J. Robbins 2002-12-20 08:28:10 +00:00
parent 5a7405be50
commit 4aca04ee5c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=108121

View File

@ -36,7 +36,7 @@
.\" @(#)printf.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
.Dd November 8, 2001
.Dd December 20, 2002
.Dt PRINTF 3
.Os
.Sh NAME
@ -111,7 +111,7 @@ are converted for output.
These functions return the number of characters printed
(not including the trailing
.Ql \e0
used to end output to strings),
used to end output to strings) or a negative value if an output error occurs,
except for
.Fn snprintf
and
@ -767,6 +767,18 @@ for later interpolation by
Always use the proper secure idiom:
.Pp
.Dl "snprintf(buffer, sizeof(buffer), \*q%s\*q, string);"
.Sh ERRORS
In addition to the errors documented for the
.Xr write 2
system call, the
.Fn printf
family of functions may fail if:
.Bl -tag -width Er
.It Bq Er EILSEQ
An invalid wide character code was encountered.
.It Bq Er ENOMEM
Insufficient storage space is available.
.El
.Sh SEE ALSO
.Xr printf 1 ,
.Xr fmtcheck 3 ,