diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/openac/openac.c | 5 | ||||
-rw-r--r-- | src/scepclient/loglite.c | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/openac/openac.c b/src/openac/openac.c index 408da7f0c..f61a9463c 100755 --- a/src/openac/openac.c +++ b/src/openac/openac.c @@ -218,15 +218,16 @@ static void openac_dbg(int level, char *fmt, ...) if (level <= debug_level) { - va_start(args, fmt); - if (!stderr_quiet) { + va_start(args, fmt); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); + va_end(args); } /* write in memory buffer first */ + va_start(args, fmt); vsnprintf(buffer, sizeof(buffer), fmt, args); va_end(args); diff --git a/src/scepclient/loglite.c b/src/scepclient/loglite.c index b14e72ecb..87041f114 100644 --- a/src/scepclient/loglite.c +++ b/src/scepclient/loglite.c @@ -68,21 +68,23 @@ static void scepclient_dbg(int level, char *fmt, ...) if (level <= debug_level) { - va_start(args, fmt); - if (log_to_stderr) { if (level > 1) { fprintf(stderr, "| "); } + va_start(args, fmt); vfprintf(stderr, fmt, args); + va_end(args); fprintf(stderr, "\n"); } if (log_to_syslog) { /* write in memory buffer first */ + va_start(args, fmt); vsnprintf(buffer, sizeof(buffer), fmt, args); + va_end(args); /* do a syslog with every line */ while (current) @@ -96,7 +98,6 @@ static void scepclient_dbg(int level, char *fmt, ...) current = next; } } - va_end(args); } } |