Code

write_graphite: avoid printing out the NULL value in error messages
authorWilfried Goesgens <dothebart@citadel.org>
Tue, 17 Sep 2013 19:15:02 +0000 (21:15 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Sat, 21 Sep 2013 13:39:09 +0000 (15:39 +0200)
src/write_graphite.c

index 667c11e3dd9aca469c438c27d477fb718b6ad904..c3d6bf103490a7f2f4dfeefe33f6d42db0f9f39b 100644 (file)
@@ -131,8 +131,10 @@ static int wg_send_buffer (struct wg_callback *cb)
     if (cb->log_send_errors && status < 0)
     {
         char errbuf[1024];
+        const char *protocol = cb->protocol ? cb->protocol : WG_DEFAULT_PROTOCOL;
+
         ERROR ("write_graphite plugin: send to %s:%s (%s) failed with status %zi (%s)",
-                cb->node, cb->service, cb->protocol,
+                cb->node, cb->service, protocol,
                 status, sstrerror (errno, errbuf, sizeof (errbuf)));