Code

utils_format_json.c: offset is unsigned
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 23 Apr 2016 08:41:07 +0000 (10:41 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 23 Apr 2016 08:41:07 +0000 (10:41 +0200)
[src/utils_format_json.c:300]: (style) Checking if unsigned variable 'offset' is less than zero.

src/utils_format_json.c

index 2c0e4cd029b3f29c3b05521f1171541c9f591679..800b4219109b6070b64157620bb97fb6c5a17a70 100644 (file)
@@ -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 ',' */