From 7ac2eb01fc3ba2c85f8340693a679e3ecea5318b Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sun, 24 Nov 2019 13:51:49 +0900 Subject: [PATCH] Do not resuse va_list without reinitialization Fixes #206. --- src/util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util.c b/src/util.c index 73600c4..3022632 100644 --- a/src/util.c +++ b/src/util.c @@ -12,6 +12,9 @@ void mbp_log(int level, const char *fmt, ...) if (daemonize) { vsyslog(level, fmt, args); } + va_end(args); + + va_start(args, fmt); vprintf(fmt, args); puts(""); // trailing newline va_end(args);