Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2006-05-15 16:36:35 +0000
committerJudd Vinet <judd@archlinux.org>2006-05-15 16:36:35 +0000
commit1a30bc554d7d29f68515ab3feb308df7762918b3 (patch)
tree121524574a1277da31fc686a636648ad879cb884
parentbb787e26ee01f961c76fbe4e568275a66e80009f (diff)
patch: check strlen of str, NOT msg, which is always true
-rw-r--r--src/pacman/log.c8
1 files 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