X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Futils_format_json.c;h=99996b4c873df8c451da9f1c5b56416d5580add0;hb=4103105fb43cd72294f165b2541540b3a8a99532;hp=2c0e4cd029b3f29c3b05521f1171541c9f591679;hpb=82c9b0daf5ff90d01f4a4371f11727cd613e4b01;p=collectd.git diff --git a/src/utils_format_json.c b/src/utils_format_json.c index 2c0e4cd0..99996b4c 100644 --- a/src/utils_format_json.c +++ b/src/utils_format_json.c @@ -25,6 +25,7 @@ **/ #include "collectd.h" + #include "plugin.h" #include "common.h" @@ -297,7 +298,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 ',' */