From: Ruben Kerkhof Date: Sat, 23 Apr 2016 08:41:07 +0000 (+0200) Subject: utils_format_json.c: offset is unsigned X-Git-Tag: collectd-5.6.0~329^2~37 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=65923b02496661196d79d3a565cab58a2b52f938;p=collectd.git utils_format_json.c: offset is unsigned [src/utils_format_json.c:300]: (style) Checking if unsigned variable 'offset' is less than zero. --- diff --git a/src/utils_format_json.c b/src/utils_format_json.c index 2c0e4cd0..800b4219 100644 --- a/src/utils_format_json.c +++ b/src/utils_format_json.c @@ -297,7 +297,7 @@ static int meta_data_keys_to_json (char *buffer, size_t buffer_size, /* {{{ */ } } /* for (keys) */ - if (offset <= 0) + if (offset == 0) return (ENOENT); buffer[0] = '{'; /* replace leading ',' */