From fa6404e461bf26a225d60b8dd963917894a8f846 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Tue, 17 Sep 2013 21:15:02 +0200 Subject: [PATCH] write_graphite: avoid printing out the NULL value in error messages --- src/write_graphite.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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))); -- 2.11.0