From: Jaroslav Kysela Date: Sun, 29 Dec 2013 19:03:21 +0000 (+0100) Subject: alsactl: Fix the va_list initialization in cerror_() and dbg_() X-Git-Tag: v1.0.28~19 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=f4be3f88b6e80e3f3ea19ba5784cff49ab6e6277;p=alsa-utils.git alsactl: Fix the va_list initialization in cerror_() and dbg_() The argument for syslog_() was uninitialized. From: Alan Hamilton Signed-off-by: Jaroslav Kysela --- diff --git a/alsactl/utils.c b/alsactl/utils.c index 072c239..b5d183c 100644 --- a/alsactl/utils.c +++ b/alsactl/utils.c @@ -150,10 +150,10 @@ void cerror_(const char *fcn, long line, int cond, const char *fmt, ...) if (!cond && !debugflag) return; + va_start(ap, fmt); if (use_syslog) { syslog_(LOG_ERR, fcn, line, fmt, ap); } else { - va_start(ap, fmt); fprintf(stderr, "%s: %s:%ld: ", command, fcn, line); vfprintf(stderr, fmt, ap); putc('\n', stderr); @@ -167,10 +167,10 @@ void dbg_(const char *fcn, long line, const char *fmt, ...) if (!debugflag) return; + va_start(ap, fmt); if (use_syslog) { syslog_(LOG_DEBUG, fcn, line, fmt, ap); } else { - va_start(ap, fmt); fprintf(stderr, "%s: %s:%ld: ", command, fcn, line); vfprintf(stderr, fmt, ap); putc('\n', stderr);