From owner-svn-src-all@FreeBSD.ORG Mon Mar 2 04:11:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7CF81065782; Mon, 2 Mar 2009 04:11:42 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C745E8FC0A; Mon, 2 Mar 2009 04:11:42 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n224BgUQ064834; Mon, 2 Mar 2009 04:11:42 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n224BgXF064833; Mon, 2 Mar 2009 04:11:42 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200903020411.n224BgXF064833@svn.freebsd.org> From: David Schultz Date: Mon, 2 Mar 2009 04:11:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189271 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2009 04:11:43 -0000 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 __FBSDID("$FreeBSD$"); @@ -40,13 +37,13 @@ __FBSDID("$FreeBSD$"); #include 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); }