Change all references from avsprintf to vasprintf. From Sebastien Lorquet

This commit is contained in:
Sebastien Lorquet
2015-09-07 13:10:40 -06:00
committed by Gregory Nutt
parent 413ebde3b3
commit 77e4e7b231
8 changed files with 14 additions and 12 deletions
+1 -1
View File
@@ -38,7 +38,7 @@
# C streams.
CSRCS += lib_fileno.c lib_printf.c lib_sprintf.c lib_asprintf.c
CSRCS += lib_snprintf.c lib_libsprintf.c lib_vsprintf.c lib_avsprintf.c
CSRCS += lib_snprintf.c lib_libsprintf.c lib_vsprintf.c lib_vasprintf.c
CSRCS += lib_vsnprintf.c lib_libvsprintf.c lib_dprintf.c lib_vdprintf.c
CSRCS += lib_meminstream.c lib_memoutstream.c lib_memsistream.c
CSRCS += lib_memsostream.c lib_lowinstream.c lib_lowoutstream.c
+2 -2
View File
@@ -97,10 +97,10 @@ int asprintf (FAR char **ptr, const char *fmt, ...)
va_list ap;
int ret;
/* Let avsprintf do all of the work */
/* Let vasprintf do all of the work */
va_start(ap, fmt);
ret = avsprintf(ptr, fmt, ap);
ret = vasprintf(ptr, fmt, ap);
va_end(ap);
return ret;
+5 -5
View File
@@ -1,5 +1,5 @@
/****************************************************************************
* libc/stdio/lib_avsprintf.c
* libc/stdio/lib_vasprintf.c
*
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -49,7 +49,7 @@
****************************************************************************/
/* On some architectures, va_list is really a pointer to a structure on the
* stack. And the va_arg builtin will modify that instance of va_list. Since
* avsprintf traverse the parameters in the va_list twice, the va_list will
* vasprintf traverse the parameters in the va_list twice, the va_list will
* be altered in this first cases and the second usage will fail. So far, I
* have seen this only on the X86 family with GCC.
*/
@@ -95,14 +95,14 @@
****************************************************************************/
/****************************************************************************
* Name: avsprintf
* Name: vasprintf
*
* Description:
* This function is similar to vsprintf, except that it dynamically
* allocates a string (as with malloc) to hold the output, instead of
* putting the output in a buffer you allocate in advance. The ptr
* argument should be the address of a char * object, and a successful
* call to avsprintf stores a pointer to the newly allocated string at that
* call to vasprintf stores a pointer to the newly allocated string at that
* location.
*
* Returned Value:
@@ -112,7 +112,7 @@
*
****************************************************************************/
int avsprintf(FAR char **ptr, const char *fmt, va_list ap)
int vasprintf(FAR char **ptr, const char *fmt, va_list ap)
{
struct lib_outstream_s nulloutstream;
struct lib_memoutstream_s memoutstream;