diff options
author | Eric Blake <eblake@redhat.com> | 2008-04-30 02:47:14 +0000 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2008-04-30 02:47:14 +0000 |
commit | f77a1a884885a10a5210a42ad9bff6514eb0c374 (patch) | |
tree | 2117fdee5ce76bd659cff7629cb0c9d7b7e24bb9 /newlib/libc/stdio/asnprintf.c | |
parent | 661efd2deaf2042829683112411be7f7902abe13 (diff) | |
download | newlib-f77a1a884885a10a5210a42ad9bff6514eb0c374.zip newlib-f77a1a884885a10a5210a42ad9bff6514eb0c374.tar.gz newlib-f77a1a884885a10a5210a42ad9bff6514eb0c374.tar.bz2 |
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.
Diffstat (limited to 'newlib/libc/stdio/asnprintf.c')
-rw-r--r-- | newlib/libc/stdio/asnprintf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/newlib/libc/stdio/asnprintf.c b/newlib/libc/stdio/asnprintf.c index ef9bd89..bb7057a 100644 --- a/newlib/libc/stdio/asnprintf.c +++ b/newlib/libc/stdio/asnprintf.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(_asnprintf_r, (ptr, buf, lenp, fmt), f._bf._size = f._w = len; f._file = -1; /* No file. */ va_start (ap, fmt); - ret = _vfprintf_r (ptr, &f, fmt, ap); + ret = _svfprintf_r (ptr, &f, fmt, ap); va_end (ap); if (ret < 0) return NULL; @@ -95,7 +95,7 @@ _DEFUN(asnprintf, (buf, lenp, fmt), f._bf._size = f._w = len; f._file = -1; /* No file. */ va_start (ap, fmt); - ret = _vfprintf_r (ptr, &f, fmt, ap); + ret = _svfprintf_r (ptr, &f, fmt, ap); va_end (ap); if (ret < 0) return NULL; |