patch: check strlen of str, NOT msg, which is always true
This commit is contained in:
parent
bb787e26ee
commit
1a30bc554d
1 changed files with 5 additions and 3 deletions
|
@ -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,9 +73,7 @@ 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
|
||||||
|
|
Loading…
Add table
Reference in a new issue