X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=draft%2Fman3%2Fprintf.3;h=a8b618d9e6568c24d19b56928e1c61f5de1848dc;hb=ebe1df63d4498f4546ed0bd074cedbb5eb69564c;hp=038206a9e70352d03f572310ef70367a06a7726a;hpb=fc763faabe545d972b718551999cbd8204464dd6;p=linuxjm%2FLDP_man-pages.git
diff --git a/draft/man3/printf.3 b/draft/man3/printf.3
index 038206a9..a8b618d9 100644
--- a/draft/man3/printf.3
+++ b/draft/man3/printf.3
@@ -1,5 +1,12 @@
.\" Copyright (c) 1999 Andries Brouwer (aeb@cwi.nl)
.\"
+.\" Earlier versions of this page influenced the present text.
+.\" It was derived from a Berkeley page with version
+.\" @(#)printf.3 6.14 (Berkeley) 7/30/91
+.\" converted for Linux by faith@cs.unc.edu, updated by
+.\" Helmut.Geyer@iwr.uni-heidelberg.de, agulbra@troll.no and Bruno Haible.
+.\"
+.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
@@ -16,16 +23,9 @@
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
-.\" License along with this manual; if not, write to the Free
-.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
-.\" USA.
-.\"
-.\"
-.\" Earlier versions of this page influenced the present text.
-.\" It was derived from a Berkeley page with version
-.\" @(#)printf.3 6.14 (Berkeley) 7/30/91
-.\" converted for Linux by faith@cs.unc.edu, updated by
-.\" Helmut.Geyer@iwr.uni-heidelberg.de, agulbra@troll.no and Bruno Haible.
+.\" License along with this manual; if not, see
+.\" .
+.\" %%%LICENSE_END
.\"
.\" 1999-11-25 aeb - Rewritten, using SUSv2 and C99.
.\" 2000-07-26 jsm28@hermes.cam.ac.uk - three small fixes
@@ -36,7 +36,7 @@
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
-.TH PRINTF 3 2011\-09\-28 GNU "Linux Programmer's Manual"
+.TH PRINTF 3 2013\-03\-05 GNU "Linux Programmer's Manual"
.SH åå
printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, vsnprintf \-
æå®ãããæ¸å¼ã«å¤æãã¦åºåãè¡ã
@@ -464,6 +464,8 @@ fprintf(stdout, format,
ã§ããã°ã "Sonntag, 3. Juli, 10:02" ã¨ããçµæã«ãªãã
.PP
ååã«å¤§ããªæååé åã確ä¿ãã¦ãããã«ã¡ãã»ã¼ã¸ãæ ¼ç´ããã«ã¯ (glibc 2.0 㨠glibc 2.1 ã®ä¸¡æ¹ã§æ£ããåä½ããã³ã¼ã):
+.PP
+ãã¼ã¸ã§ã³ 2.0.6 ããåã® glibc ã§åãè©°ããèµ·ãã£ãå ´åãåãè©°ãã¯é©åã«å¦çããããã¨ã©ã¼ã¨ãã¦æ±ãããã
.nf
#include
@@ -474,7 +476,7 @@ char *
make_message(const char *fmt, ...)
{
int n;
- int size = 100; /* Guess we need no more than 100 bytes. */
+ int size = 100; /* Guess we need no more than 100 bytes */
char *p, *np;
va_list ap;
@@ -483,23 +485,26 @@ make_message(const char *fmt, ...)
while (1) {
- /* Try to print in the allocated space. */
+ /* Try to print in the allocated space */
va_start(ap, fmt);
n = vsnprintf(p, size, fmt, ap);
va_end(ap);
- /* If that worked, return the string. */
+ /* Check error code */
- if (n > \-1 && n < size)
+ if (n < 0)
+ return NULL;
+
+ /* If that worked, return the string */
+
+ if (n < size)
return p;
- /* Else try again with more space. */
+ /* Else try again with more space */
+
+ size = n + 1; /* Precisely what is needed */
- if (n > \-1) /* glibc 2.1 */
- size = n+1; /* precisely what is needed */
- else /* glibc 2.0 */
- size *= 2; /* twice the old size */
if ((np = realloc (p, size)) == NULL) {
free(p);
@@ -514,6 +519,6 @@ make_message(const char *fmt, ...)
\fBprintf\fP(1), \fBasprintf\fP(3), \fBdprintf\fP(3), \fBscanf\fP(3), \fBsetlocale\fP(3),
\fBwcrtomb\fP(3), \fBwprintf\fP(3), \fBlocale\fP(5)
.SH ãã®ææ¸ã«ã¤ãã¦
-ãã® man ãã¼ã¸ã¯ Linux \fIman\-pages\fP ããã¸ã§ã¯ãã®ãªãªã¼ã¹ 3.41 ã®ä¸é¨
+ãã® man ãã¼ã¸ã¯ Linux \fIman\-pages\fP ããã¸ã§ã¯ãã®ãªãªã¼ã¹ 3.51 ã®ä¸é¨
ã§ãããããã¸ã§ã¯ãã®èª¬æã¨ãã°å ±åã«é¢ããæ
å ±ã¯
http://www.kernel.org/doc/man\-pages/ ã«æ¸ããã¦ããã