mirror of
https://github.com/linux-msm/pd-mapper.git
synced 2026-02-25 13:12:10 -08:00
fixup! json: Introduce JSON parser
This commit is contained in:
4
json.c
4
json.c
@@ -81,7 +81,7 @@ static int json_parse_string(struct json_value *value)
|
||||
return 0;
|
||||
}
|
||||
|
||||
while ((ch = input()) && ch != '"')
|
||||
while ((ch = input()) && ch != '"' && b - buf < sizeof(buf) - 1)
|
||||
*b++ = ch;
|
||||
*b = '\0';
|
||||
|
||||
@@ -350,7 +350,7 @@ struct json_value *json_parse_file(const char *file)
|
||||
|
||||
ret = json_parse_value(root);
|
||||
if (ret != 1) {
|
||||
free(root);
|
||||
json_free(root);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user