From: Ruben Kerkhof Date: Wed, 23 May 2018 13:39:23 +0000 (+0200) Subject: table plugin: fix build warning X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8a103937ee6bce58ae4c6564ba3a44caf4a0e5a2;p=collectd.git table plugin: fix build warning src/table.c:399:11: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] if (r >= sizeof(vl.type_instance)) ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. --- diff --git a/src/table.c b/src/table.c index ae26c789..189d6057 100644 --- a/src/table.c +++ b/src/table.c @@ -396,7 +396,7 @@ static int tbl_result_dispatch(tbl_t *tbl, tbl_result_t *res, char **fields, else r = snprintf(vl.type_instance, sizeof(vl.type_instance), "%s-%s", res->instance_prefix, instances_str); - if (r >= sizeof(vl.type_instance)) + if ((size_t)r >= sizeof(vl.type_instance)) log_warn("Truncated type instance: %s.", vl.type_instance); }