Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/stdio Document that passing NULL to %s prints "(nul...



details:   https://anonhg.NetBSD.org/src/rev/1ad5836fa2b3
branches:  trunk
changeset: 582234:1ad5836fa2b3
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jun 21 18:43:17 2005 +0000

description:
Document that passing NULL to %s prints "(null)".

diffstat:

 lib/libc/stdio/printf.3 |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r c274ce83d633 -r 1ad5836fa2b3 lib/libc/stdio/printf.3
--- a/lib/libc/stdio/printf.3   Tue Jun 21 18:34:47 2005 +0000
+++ b/lib/libc/stdio/printf.3   Tue Jun 21 18:43:17 2005 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: printf.3,v 1.38 2003/09/08 17:54:32 wiz Exp $
+.\"    $NetBSD: printf.3,v 1.39 2005/06/21 18:43:17 christos Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -33,7 +33,7 @@
 .\"
 .\"     @(#)printf.3   8.1 (Berkeley) 6/4/93
 .\"
-.Dd May 11, 2003
+.Dd June 21, 2005
 .Dt PRINTF 3
 .Os
 .Sh NAME
@@ -813,6 +813,17 @@
 last positionally specified parameter, are used in the format string.
 This allows for the format string to be parsed for this information.
 Failure to do this will mean your code is non-portable and liable to fail.
+.Pp
+In this implementation, passing a
+.Dv NULL
+.Vt char *
+argument to the
+.Cm %s
+format specifier will output
+.Em "(null)"
+instead of crashing.
+Programs that depend on this behavior are non-portable and may crash
+on other systems or in the future.
 .Sh BUGS
 The conversion formats
 .Cm \&%D ,



Home | Main Index | Thread Index | Old Index