From 9f962c47f0fe250c8bb1e03ed8c3ded9ce686c29 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Wed, 20 Feb 2019 12:14:18 +0100 Subject: [PATCH] write_prometheus plugin: fix compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit make[1]: Entering directory '/home/ruben/src/collectd' CC src/write_prometheus_la-write_prometheus.lo In file included from src/write_prometheus.c:29: src/write_prometheus.c: In function ‘metric_family_get’: ./src/daemon/plugin.h:393:20: warning: ‘%s’ directive argument is null [-Wformat-overflow=] 393 | #define ERROR(...) plugin_log(LOG_ERR, __VA_ARGS__) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/write_prometheus.c:725:5: note: in expansion of macro ‘ERROR’ 725 | ERROR("write_prometheus plugin: Adding \"%s\" failed.", name); | ^~~~~ src/write_prometheus.c:725:46: note: format string is defined here 725 | ERROR("write_prometheus plugin: Adding \"%s\" failed.", name); | ^~ CCLD write_prometheus.la --- src/write_prometheus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/write_prometheus.c b/src/write_prometheus.c index b109d422..96e71ca1 100644 --- a/src/write_prometheus.c +++ b/src/write_prometheus.c @@ -722,7 +722,7 @@ metric_family_get(data_set_t const *ds, value_list_t const *vl, size_t ds_index, int status = c_avl_insert(metrics, fam->name, fam); if (status != 0) { - ERROR("write_prometheus plugin: Adding \"%s\" failed.", name); + ERROR("write_prometheus plugin: Adding \"%s\" failed.", fam->name); metric_family_destroy(fam); return NULL; } -- 2.11.0