From: Andrii Simiklit <andrii.simik...@globallogic.com>

The first usage of the 'va_list' instance could change it.

Reviewed-by: Eric Engestrom <eric.engest...@intel.com>
Fixes: 864148d69e1e "util: add util_vasprintf() for Windows (v2)"
Signed-off-by: Andrii Simiklit <andrii.simik...@globallogic.com>

---
 src/util/u_string.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/u_string.h b/src/util/u_string.h
index ce45430..374c00e 100644
--- a/src/util/u_string.h
+++ b/src/util/u_string.h
@@ -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)
-- 
2.7.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to