From: Florian Forster Date: Wed, 21 Apr 2010 14:23:46 +0000 (+0200) Subject: src/plugin.c: plugin_log: Append newline to message … X-Git-Tag: collectd-4.8.5~1 X-Git-Url: https://git.tokkee.org/?p=collectd.git;a=commitdiff_plain;h=a841b5f2882acf431f4fd0783f602f3ae80716c5 src/plugin.c: plugin_log: Append newline to message … … even when no log-plugin was loaded. --- diff --git a/src/plugin.c b/src/plugin.c index c163ca7d..647c1fb6 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1459,14 +1459,6 @@ void plugin_log (int level, const char *format, ...) va_list ap; llentry_t *le; - if (list_log == NULL) - { - va_start (ap, format); - vfprintf (stderr, format, ap); - va_end (ap); - return; - } - #if !COLLECT_DEBUG if (level >= LOG_DEBUG) return; @@ -1477,6 +1469,12 @@ void plugin_log (int level, const char *format, ...) msg[sizeof (msg) - 1] = '\0'; va_end (ap); + if (list_log == NULL) + { + fprintf (stderr, "%s\n", msg); + return; + } + le = llist_head (list_log); while (le != NULL) {