summaryrefslogtreecommitdiff
path: root/src/helper
diff options
context:
space:
mode:
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/log.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/helper/log.c b/src/helper/log.c
index b3898723..5127a373 100644
--- a/src/helper/log.c
+++ b/src/helper/log.c
@@ -284,9 +284,12 @@ char *alloc_printf(const char *fmt, va_list ap)
free(t);
return NULL;
}
-
+
+ va_list ap_copy;
+ va_copy(ap_copy, ap);
+
int ret;
- ret = vsnprintf(string, size, fmt, ap);
+ ret = vsnprintf(string, size, fmt, ap_copy);
/* NB! The result of the vsnprintf() might be an *EMPTY* string! */
if ((ret >= 0) && ((ret + 1) < size))
break;