From 7bb760247e39c8e46f57fb5cc5e6cdbe4833fe7b Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 20 Apr 2014 14:10:03 +0200 Subject: [PATCH] plugin: Log to stderr if no logger has been registered. Check the length of the list rather than replying on it being uninitialized. --- src/core/plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.30.2