Note that for asprintf and vasprintf it is more portable to check for

a -1 return, rather than ret being set to NULL on error.

From Otto Moerbeek.
This commit is contained in:
rumble 2006-03-18 05:46:04 +00:00
parent ee17e957e3
commit 43d45c06c6
1 changed files with 7 additions and 2 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: printf.3,v 1.40 2005/07/20 13:31:15 christos Exp $
.\" $NetBSD: printf.3,v 1.41 2006/03/18 05:46:04 rumble 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 July 20, 2005
.Dd March 17, 2006
.Dt PRINTF 3
.Os
.Sh NAME
@ -132,6 +132,11 @@ If sufficient space cannot be allocated, these functions
will return -1 and set
.Fa ret
to be a NULL pointer.
Please note that these functions are not standardized, and not all
implementations can be assumed to set the
.Fa ret
argument to NULL on error.
It is more portable to check for a return value of -1 instead.
.Pp
.Fn snprintf
and