From: Wilfried Goesgens Date: Tue, 17 Sep 2013 19:15:02 +0000 (+0200) Subject: write_graphite: avoid printing out the NULL value in error messages X-Git-Tag: collectd-5.4.1~9 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fa6404e461bf26a225d60b8dd963917894a8f846;p=collectd.git write_graphite: avoid printing out the NULL value in error messages --- diff --git a/src/write_graphite.c b/src/write_graphite.c index 667c11e3..c3d6bf10 100644 --- a/src/write_graphite.c +++ b/src/write_graphite.c @@ -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)));