aboutsummaryrefslogtreecommitdiff
path: root/redist/json_helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'redist/json_helpers.c')
-rw-r--r--redist/json_helpers.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/redist/json_helpers.c b/redist/json_helpers.c
index 115076e..eb3600b 100644
--- a/redist/json_helpers.c
+++ b/redist/json_helpers.c
@@ -164,7 +164,8 @@ void json_load_file(const char* path) {
jsmn_parser parser;
jsmn_init(&parser);
- uint32_t items = jsmn_parse(&parser, JSON_STRING, JSON_STRING_LEN, NULL, 0);
+ int32_t items = jsmn_parse(&parser, JSON_STRING, JSON_STRING_LEN, NULL, 0);
+ if (items < 0) return;
jsmntok_t* tokens = malloc(items * sizeof(jsmntok_t));
jsmn_init(&parser);