From 1a30bc554d7d29f68515ab3feb308df7762918b3 Mon Sep 17 00:00:00 2001 From: Judd Vinet Date: Mon, 15 May 2006 16:36:35 +0000 Subject: patch: check strlen of str, NOT msg, which is always true --- src/pacman/log.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pacman/log.c b/src/pacman/log.c index 35cef028..2d929bd1 100644 --- a/src/pacman/log.c +++ b/src/pacman/log.c @@ -45,6 +45,10 @@ void cb_log(unsigned short level, char *msg) { char str[9] = ""; + if(!strlen(msg)) { + return; + } + switch(level) { case PM_LOG_DEBUG: sprintf(str, _("debug")); @@ -69,9 +73,7 @@ void cb_log(unsigned short level, char *msg) break; } - if(strlen(str) > 0) { - MSG(NL, "%s: %s\n", str, msg); - } + MSG(NL, "%s: %s\n", str, msg); } /* Wrapper to fprintf() that allows to choose if we want the output -- cgit v1.2.3-24-g4f1b