From: Ruben Kerkhof Date: Tue, 19 Feb 2019 17:53:19 +0000 (+0100) Subject: sensu plugin: fix compiler warning when build with --enable-debug X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=639c5b1ea0665a3bad006b8f02b03c52f304038c;p=collectd.git sensu plugin: fix compiler warning when build with --enable-debug 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); | --- 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.",