From 639c5b1ea0665a3bad006b8f02b03c52f304038c Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Tue, 19 Feb 2019 18:53:19 +0100 Subject: [PATCH] sensu plugin: fix compiler warning when build with --enable-debug MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In file included from src/write_sensu.c:31: src/write_sensu.c: In function ‘sensu_config’: ./src/daemon/plugin.h:398:20: warning: ‘%s’ directive argument is null [-Wformat-overflow=] 398 | #define DEBUG(...) plugin_log(LOG_DEBUG, __VA_ARGS__) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/write_sensu.c:1227:7: note: in expansion of macro ‘DEBUG’ 1227 | DEBUG("write_sensu plugin: Got tag: %s", tmp); | ^~~~~ src/write_sensu.c:1227:43: note: format string is defined here 1227 | DEBUG("write_sensu plugin: Got tag: %s", tmp); | --- src/write_sensu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/write_sensu.c b/src/write_sensu.c index 1bff27b3..7d08fb5f 100644 --- a/src/write_sensu.c +++ b/src/write_sensu.c @@ -1221,10 +1221,10 @@ static int sensu_config(oconfig_item_t *ci) /* {{{ */ continue; status = add_str_to_list(&sensu_tags_arr, tmp); + DEBUG("write_sensu plugin: Got tag: %s", tmp); sfree(tmp); if (status != 0) continue; - DEBUG("write_sensu plugin: Got tag: %s", tmp); } else { WARNING("write_sensu plugin: Ignoring unknown " "configuration option \"%s\" at top level.", -- 2.11.0