From f42bb0b021a42b69c2fae65a8e33b0a170f43539 Mon Sep 17 00:00:00 2001 From: Andreas Schlick Date: Thu, 24 Feb 2011 17:27:11 +0100 Subject: [PATCH 1/1] failtest: Fix incorrect reuse of va_list in test/run-malloc.c. --- ccan/failtest/test/run-malloc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ccan/failtest/test/run-malloc.c b/ccan/failtest/test/run-malloc.c index 5849ef65..3912bfd0 100644 --- a/ccan/failtest/test/run-malloc.c +++ b/ccan/failtest/test/run-malloc.c @@ -48,8 +48,13 @@ static char *output = NULL; static int saved_vprintf(const char *fmt, va_list ap) { - int ret = vsnprintf(NULL, 0, fmt, ap); + int ret; int len = 0; + va_list ap2; + + va_copy(ap2, ap); + ret = vsnprintf(NULL, 0, fmt, ap2); + va_end(ap2); if (output) len = strlen(output); -- 2.39.2