libc/vsprintf_internal: Call va_copy just like vsyslog

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2021-10-09 14:32:59 +08:00 committed by Gustavo Henrique Nihei
parent 82813472d1
commit 1e607a70bc

View File

@ -464,7 +464,15 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
if (fmt_char(fmt) == 'V')
{
FAR struct va_format *vaf = va_arg(ap, void *);
#ifdef va_copy
va_list copy;
va_copy(copy, *vaf->va);
vsprintf_internal(stream, NULL, 0, vaf->fmt, copy);
va_end(copy);
#else
vsprintf_internal(stream, NULL, 0, vaf->fmt, *vaf->va);
#endif
continue;
}
else