mesa/util: don't use the same 'va_list' instance twice
The first usage of the 'va_list' instance could change it.
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Fixes: 864148d69e
"util: add util_vasprintf() for Windows (v2)"
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
This commit is contained in:
parent
267ed29288
commit
570cacba7a
|
@ -119,7 +119,7 @@ util_vasprintf(char **ret, const char *format, va_list ap)
|
|||
|
||||
/* Compute length of output string first */
|
||||
va_copy(ap_copy, ap);
|
||||
int r = util_vsnprintf(NULL, 0, format, ap);
|
||||
int r = util_vsnprintf(NULL, 0, format, ap_copy);
|
||||
va_end(ap_copy);
|
||||
|
||||
if (r < 0)
|
||||
|
|
Loading…
Reference in New Issue