Only call va_start when needed

This commit is contained in:
Andrew Gaul 2019-11-24 16:09:31 +09:00
parent 7ac2eb01fc
commit 49f544fd8d

View file

@ -8,11 +8,11 @@
void mbp_log(int level, const char *fmt, ...) void mbp_log(int level, const char *fmt, ...)
{ {
va_list args; va_list args;
va_start(args, fmt);
if (daemonize) { if (daemonize) {
va_start(args, fmt);
vsyslog(level, fmt, args); vsyslog(level, fmt, args);
}
va_end(args); va_end(args);
}
va_start(args, fmt); va_start(args, fmt);
vprintf(fmt, args); vprintf(fmt, args);