Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Mar 2009 04:11:42 +0000 (UTC)
From:      David Schultz <das@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r189271 - head/lib/libc/stdio
Message-ID:  <200903020411.n224BgXF064833@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: das
Date: Mon Mar  2 04:11:42 2009
New Revision: 189271
URL: http://svn.freebsd.org/changeset/base/189271

Log:
  Rewrite asprintf() as a wrapper around vasprintf(), thus reducing the
  number of functions that have an incestuous relationship with the
  arcane innards of stdio.

Replaced:
  head/lib/libc/stdio/asprintf.c   (contents, props changed)
     - copied, changed from r189249, head/lib/libc/stdio/printf.c

Copied and modified: head/lib/libc/stdio/asprintf.c (from r189249, head/lib/libc/stdio/printf.c)
==============================================================================
--- head/lib/libc/stdio/printf.c	Sun Mar  1 19:25:40 2009	(r189249, copy source)
+++ head/lib/libc/stdio/asprintf.c	Mon Mar  2 04:11:42 2009	(r189271)
@@ -30,9 +30,6 @@
  * SUCH DAMAGE.
  */
 
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)printf.c	8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
@@ -40,13 +37,13 @@ __FBSDID("$FreeBSD$");
 #include <stdarg.h>
 
 int
-printf(char const * __restrict fmt, ...)
+asprintf(char ** __restrict s, char const * __restrict fmt, ...)
 {
 	int ret;
 	va_list ap;
 
 	va_start(ap, fmt);
-	ret = vfprintf(stdout, fmt, ap);
+	ret = vasprintf(s, fmt, ap);
 	va_end(ap);
 	return (ret);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903020411.n224BgXF064833>