From: Ruben Kerkhof Date: Thu, 31 May 2018 13:29:08 +0000 (+0200) Subject: write_sensu plugin: fix implicit conversion X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=5c35d13ad952c2fbcd3dfa41a77200097e2d2dc8;p=collectd.git write_sensu plugin: fix implicit conversion CC src/write_sensu.lo src/write_sensu.c:312:13: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int len = strlen(orig_name); ~~~ ^~~~~~~~~~~~~~~~~ 1 warning generated. --- diff --git a/src/write_sensu.c b/src/write_sensu.c index bda33278..4c9f42ba 100644 --- a/src/write_sensu.c +++ b/src/write_sensu.c @@ -309,8 +309,8 @@ static int sensu_format_name2(char *ret, int ret_len, const char *hostname, static void in_place_replace_sensu_name_reserved(char *orig_name) /* {{{ */ { - int len = strlen(orig_name); - for (int i = 0; i < len; i++) { + size_t len = strlen(orig_name); + for (size_t i = 0; i < len; i++) { // some plugins like ipmi generate special characters in metric name switch (orig_name[i]) { case '(':