write_prometheus plugin: fix compiler warning
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Wed, 20 Feb 2019 11:14:18 +0000 (12:14 +0100)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Wed, 20 Feb 2019 11:14:18 +0000 (12:14 +0100)
commit9f962c47f0fe250c8bb1e03ed8c3ded9ce686c29
tree79380d7f6d72d9e96cd6a90455a6fdfbc86692e1
parentb1bbe317076cd1e52b6a51350f656186c3c80caf
write_prometheus plugin: fix compiler warning

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