diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2023-10-05 12:33:13 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2023-10-05 17:26:06 +0200 |
commit | dfd044930689aa6d2af94d15d1372923c5302ffb (patch) | |
tree | 7ad9cc59c2d54c76c6b08d813f93d7730f0b45e7 /examples/c-json-stdout | |
parent | 07f2c2d9cc7e29b53de42c3849bc3c2e6b6b8fb9 (diff) |
Fix issues detected by SonarCloud.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'examples/c-json-stdout')
-rw-r--r-- | examples/c-json-stdout/c-json-stdout.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/c-json-stdout/c-json-stdout.c b/examples/c-json-stdout/c-json-stdout.c index 508e45588..ae082a366 100644 --- a/examples/c-json-stdout/c-json-stdout.c +++ b/examples/c-json-stdout/c-json-stdout.c @@ -104,7 +104,7 @@ int main(void) json_bytes - json_start, tokens, sizeof(tokens) / sizeof(tokens[0])); - if (r < 0 || tokens[0].type != JSMN_OBJECT) + if (r < 1 || tokens[0].type != JSMN_OBJECT) { fprintf(stderr, "JSON parsing failed with return value %d at position %u\n", r, parser.pos); fprintf(stderr, "JSON string: '%.*s'\n", (int)(json_bytes - json_start), (char *)(buf + json_start)); |