From f77a1a884885a10a5210a42ad9bff6514eb0c374 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 30 Apr 2008 02:47:14 +0000 Subject: Fix 2008-04-14 regression in asprintf(ptr,""). * libc/stdio/asnprintf.c (asnprintf, _asnprintf_r): Avoid stdio baggage. * libc/stdio/asniprintf.c (asniprintf, _asniprintf_r): Likewise. * libc/stdio/asiprintf.c (asiprintf, _asiprintf_r): Likewise. * libc/stdio/vasniprintf.c (_vasniprintf_r): Likewise. * libc/stdio/vsnprintf.c (_vsnprintf_r): Likewise. * libc/stdio/vfprintf.c (_VFPRINTF_R) [STRING_ONLY]: Always malloc an initial buffer for asprintf. --- newlib/libc/stdio/asniprintf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'newlib/libc/stdio/asniprintf.c') diff --git a/newlib/libc/stdio/asniprintf.c b/newlib/libc/stdio/asniprintf.c index dd74b7c8c..d4ff901e8 100644 --- a/newlib/libc/stdio/asniprintf.c +++ b/newlib/libc/stdio/asniprintf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2007 Eric Blake +/* Copyright (C) 2007, 2008 Eric Blake * Permission to use, copy, modify, and distribute this software * is freely granted, provided that this notice is preserved. */ @@ -48,7 +48,7 @@ _DEFUN(_asniprintf_r, (ptr, buf, lenp, fmt), f._bf._size = f._w = len; f._file = -1; /* No file. */ va_start (ap, fmt); - ret = _vfiprintf_r (ptr, &f, fmt, ap); + ret = _svfiprintf_r (ptr, &f, fmt, ap); va_end (ap); if (ret < 0) return NULL; @@ -95,7 +95,7 @@ _DEFUN(asniprintf, (buf, lenp, fmt), f._bf._size = f._w = len; f._file = -1; /* No file. */ va_start (ap, fmt); - ret = _vfiprintf_r (ptr, &f, fmt, ap); + ret = _svfiprintf_r (ptr, &f, fmt, ap); va_end (ap); if (ret < 0) return NULL; -- cgit v1.2.3