Code

src/plugin.c: plugin_log: Append newline to message …
authorFlorian Forster <octo@noris.net>
Wed, 21 Apr 2010 14:23:46 +0000 (16:23 +0200)
committerFlorian Forster <octo@noris.net>
Wed, 21 Apr 2010 14:23:46 +0000 (16:23 +0200)
… even when no log-plugin was loaded.

src/plugin.c

index c163ca7df81c178fec29f97a595e54180ee75090..647c1fb691d4b09bb2b9f74ff61b5958db6b032f 100644 (file)
@@ -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)
        {