From 60f54822b78dea6b87cde5da82a4a135e7c2b960 Mon Sep 17 00:00:00 2001 From: Dave Wallace Date: Tue, 24 Oct 2017 20:47:45 -0400 Subject: VCL-LDPRELOAD: Fix coverity warnings. - CID 178225: Constant expression result - CID 178220: Logically dead code - CID 178222: Logically dead code - CID 178227: Logically dead code - CID 178223: Same on both sides - CID 178226: Same on both sides Change-Id: Ie0c80edb41390cf2308e54938be85d865e292138 Signed-off-by: Dave Wallace --- src/vcl/vcom_socket_wrapper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/vcl/vcom_socket_wrapper.c') diff --git a/src/vcl/vcom_socket_wrapper.c b/src/vcl/vcom_socket_wrapper.c index 19a775de99e..8d546929218 100644 --- a/src/vcl/vcom_socket_wrapper.c +++ b/src/vcl/vcom_socket_wrapper.c @@ -101,6 +101,8 @@ static pthread_mutex_t libc_symbol_binding_mutex = PTHREAD_MUTEX_INITIALIZER; #ifdef NDEBUG #define SWRAP_LOG(...) #else +static unsigned int swrap_log_lvl = SWRAP_LOG_WARN; + static void swrap_log (enum swrap_dbglvl_e dbglvl, const char *func, const char *format, ...) @@ -113,13 +115,12 @@ PRINTF_ATTRIBUTE (3, 4); { char buffer[1024]; va_list va; - unsigned int lvl = SWRAP_LOG_WARN; va_start (va, format); vsnprintf (buffer, sizeof (buffer), format, va); va_end (va); - if (lvl >= dbglvl) + if (dbglvl <= swrap_log_lvl) { switch (dbglvl) { -- cgit 1.2.3-korg