From: Sebastian Harl Date: Sun, 20 Apr 2014 12:10:03 +0000 (+0200) Subject: plugin: Log to stderr if no logger has been registered. X-Git-Tag: sysdb-0.1.0~114 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7bb760247e39c8e46f57fb5cc5e6cdbe4833fe7b;p=sysdb.git plugin: Log to stderr if no logger has been registered. Check the length of the list rather than replying on it being uninitialized. --- diff --git a/src/core/plugin.c b/src/core/plugin.c index 7584aa5..188c7db 100644 --- a/src/core/plugin.c +++ b/src/core/plugin.c @@ -959,7 +959,7 @@ sdb_plugin_log(int prio, const char *msg) if (! msg) return 0; - if (! log_list) + if (! sdb_llist_len(log_list)) return fprintf(stderr, "[%s] %s\n", SDB_LOG_PRIO_TO_STRING(prio), msg); iter = sdb_llist_get_iter(log_list);