summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2005-04-14 18:19:24 +0000
committerotto <otto@openbsd.org>2005-04-14 18:19:24 +0000
commit27b1581cd5888a1115b6b2b9bdfffc2858de6bbd (patch)
tree8bd51910e92bad70c43bfa019de490b034f886ee /lib/libc/stdio
parentcompletely fix the diff command (diff)
downloadwireguard-openbsd-27b1581cd5888a1115b6b2b9bdfffc2858de6bbd.tar.xz
wireguard-openbsd-27b1581cd5888a1115b6b2b9bdfffc2858de6bbd.zip
Explain what happens when len equals 0 for snprintf().
ok jmc@ millert@
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/printf.310
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/libc/stdio/printf.3 b/lib/libc/stdio/printf.3
index 4931d4e3b3d..1eaf7375db4 100644
--- a/lib/libc/stdio/printf.3
+++ b/lib/libc/stdio/printf.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: printf.3,v 1.45 2005/02/25 03:12:44 cloder Exp $
+.\" $OpenBSD: printf.3,v 1.46 2005/04/14 18:19:24 otto Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -165,6 +165,14 @@ if the return value is greater than or equal to the
.Fa size
argument, the string was too short
and some of the printed characters were discarded.
+If
+.Fa size
+is zero,
+.Fa str
+may be a null pointer and no characters will be written;
+the number of bytes that would have been written excluding the terminating
+.Ql \e0
+byte, or \-1 on error, will be returned.
.Pp
.Fn sprintf
and