mirror of
https://github.com/alsa-project/alsa-utils
synced 2025-01-03 20:46:40 +01:00
alsactl: Fix the va_list initialization in cerror_() and dbg_()
The <ap> argument for syslog_() was uninitialized. From: Alan Hamilton <alanh@arizonaroads.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
5dfc232a9d
commit
f4be3f88b6
1 changed files with 2 additions and 2 deletions
|
@ -150,10 +150,10 @@ void cerror_(const char *fcn, long line, int cond, const char *fmt, ...)
|
||||||
|
|
||||||
if (!cond && !debugflag)
|
if (!cond && !debugflag)
|
||||||
return;
|
return;
|
||||||
|
va_start(ap, fmt);
|
||||||
if (use_syslog) {
|
if (use_syslog) {
|
||||||
syslog_(LOG_ERR, fcn, line, fmt, ap);
|
syslog_(LOG_ERR, fcn, line, fmt, ap);
|
||||||
} else {
|
} else {
|
||||||
va_start(ap, fmt);
|
|
||||||
fprintf(stderr, "%s: %s:%ld: ", command, fcn, line);
|
fprintf(stderr, "%s: %s:%ld: ", command, fcn, line);
|
||||||
vfprintf(stderr, fmt, ap);
|
vfprintf(stderr, fmt, ap);
|
||||||
putc('\n', stderr);
|
putc('\n', stderr);
|
||||||
|
@ -167,10 +167,10 @@ void dbg_(const char *fcn, long line, const char *fmt, ...)
|
||||||
|
|
||||||
if (!debugflag)
|
if (!debugflag)
|
||||||
return;
|
return;
|
||||||
|
va_start(ap, fmt);
|
||||||
if (use_syslog) {
|
if (use_syslog) {
|
||||||
syslog_(LOG_DEBUG, fcn, line, fmt, ap);
|
syslog_(LOG_DEBUG, fcn, line, fmt, ap);
|
||||||
} else {
|
} else {
|
||||||
va_start(ap, fmt);
|
|
||||||
fprintf(stderr, "%s: %s:%ld: ", command, fcn, line);
|
fprintf(stderr, "%s: %s:%ld: ", command, fcn, line);
|
||||||
vfprintf(stderr, fmt, ap);
|
vfprintf(stderr, fmt, ap);
|
||||||
putc('\n', stderr);
|
putc('\n', stderr);
|
||||||
|
|
Loading…
Reference in a new issue