svn commit: r189271 - head/lib/libc/stdio

David Schultz das at FreeBSD.org
Sun Mar 1 20:11:43 PST 2009


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);
 }


More information about the svn-src-all mailing list