Document that passing NULL to %s prints "(null)".
This commit is contained in:
parent
d2c188d7c7
commit
098f26dce7
|
@ -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 @@ If you use positional arguments you must ensure that all parameters, up to the
|
|||
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 ,
|
||||
|
|
Loading…
Reference in New Issue