patch: check strlen of str, NOT msg, which is always true

This commit is contained in:
Judd Vinet 2006-05-15 16:36:35 +00:00
parent bb787e26ee
commit 1a30bc554d

View file

@ -45,6 +45,10 @@ void cb_log(unsigned short level, char *msg)
{ {
char str[9] = ""; char str[9] = "";
if(!strlen(msg)) {
return;
}
switch(level) { switch(level) {
case PM_LOG_DEBUG: case PM_LOG_DEBUG:
sprintf(str, _("debug")); sprintf(str, _("debug"));
@ -69,10 +73,8 @@ void cb_log(unsigned short level, char *msg)
break; 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 /* Wrapper to fprintf() that allows to choose if we want the output
* to be appended on the current line, or written to a new one * to be appended on the current line, or written to a new one