From f24b1c1cdcdea66f83d87150f2819538d7179a72 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 1 May 2016 13:40:01 +0200 Subject: [PATCH] fix multi-logging --- src/util/log.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/log.c b/src/util/log.c index b5a8ef9fd..cc9fafb92 100644 --- a/src/util/log.c +++ b/src/util/log.c @@ -192,13 +192,16 @@ static void log_write(int flags, const char *module, const char *format, va_list int level = flags & LOG_LEVELS; if (lg->flags & level) { int dupe = 0; + va_list copy; + va_copy(copy, args); if (lg->flags & LOG_BRIEF) { dupe = check_dupe(format, level); } if (dupe == 0) { - lg->log(lg->data, level, NULL, format, args); + lg->log(lg->data, level, NULL, format, copy); } + va_end(copy); } } }