From: Simon Ruderich Date: Tue, 26 Feb 2013 23:41:14 +0000 (+0100) Subject: log.c: Use one printf() instead of two in log_message(). X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=a64101800c79c852cc4ab9d445c35aad0a6457eb;p=tlsproxy%2Ftlsproxy.git log.c: Use one printf() instead of two in log_message(). --- diff --git a/src/log.c b/src/log.c index 5d05e4a..e00a08d 100644 --- a/src/log.c +++ b/src/log.c @@ -41,14 +41,22 @@ void log_message(int level, const char *file, int line, const char *format, ...) default: level_string = "UNKNOWN"; } - va_start(ap, format); -#ifdef DEBUG - fprintf(stdout, "%-12s:%-3d ", file, line); -#else +#ifndef DEBUG + /* Prevent warnings. */ (void)file; (void)line; #endif - fprintf(stdout, "[%s] [%d] ", level_string, (int)pthread_self()); + + va_start(ap, format); + fprintf(stdout, +#ifdef DEBUG + "%-12s:%-3d " +#endif + "[%s] [%d] ", +#ifdef DEBUG + file, line, +#endif + level_string, (int)pthread_self()); vfprintf(stdout, format, ap); fprintf(stdout, "\n"); va_end(ap);