From a841b5f2882acf431f4fd0783f602f3ae80716c5 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 21 Apr 2010 16:23:46 +0200 Subject: [PATCH] =?utf8?q?src/plugin.c:=20plugin=5Flog:=20Append=20newline?= =?utf8?q?=20to=20message=20=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit … even when no log-plugin was loaded. --- src/plugin.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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) { -- 2.11.0