[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: snprintf function portability
From: |
Paul Eggert |
Subject: |
Re: snprintf function portability |
Date: |
Thu, 16 Aug 2001 18:33:15 -0700 (PDT) |
Thanks for the suggestion. How about the following patch instead?
I tried to tighten up the wording a bit.
2001-08-16 Paul Eggert <address@hidden>
* autoconf.texi (Function Portability): Add snprintf.
This rewords a suggestion by Kevin Ryde.
ndex: autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.507
diff -u -r1.507 autoconf.texi
--- autoconf.texi 2001/08/17 00:42:44 1.507
+++ autoconf.texi 2001/08/17 01:20:10
@@ -3251,6 +3251,18 @@
additions, please help us keeping it as complete as possible
@table @asis
address@hidden @code{snprintf}
address@hidden @fuindex snprintf
address@hidden @code{snprintf}
address@hidden @fuindex vsnprintf
address@hidden @code{vsnprintf}
+The ISO C99 standard says that if the output array isn't big enough and if
+no other errors occur, @code{snprintf} and @code{vsnprintf} truncate the
+output and return the number of bytes that ought to have been produced.
+Some older systems return the truncated length (e.g., GNU C Library
+2.0.x or IRIX 6.5), some a negative value (e.g., earlier GNU C Library),
+and some the buffer length without truncation (e.g., Solaris 7).
+
@item @code{sprintf}
- Re: snprintf function portability,
Paul Eggert <=