From 00585c403abf45ac15b53176262aee4b05641f23 Mon Sep 17 00:00:00 2001 From: "Anna (navi) Figueiredo Gomes" Date: Thu, 7 Mar 2024 21:44:45 +0100 Subject: json.c: use VLA notation Signed-off-by: Anna (navi) Figueiredo Gomes --- src/json.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/json.c b/src/json.c index 2e86eaf..cf71a90 100644 --- a/src/json.c +++ b/src/json.c @@ -143,7 +143,11 @@ enum json_parse_result parse_value(struct json **json_out, struct raw_json *raw, return ret; } -struct json *json_parse_len(const char *str, size_t size) { +struct json *json_parse(const char *str) { + return json_parse_len(strlen(str), str); +} + +struct json *json_parse_len(size_t size, const char str[size]) { if (!str || size == 0) return NULL; struct json *json = NULL; -- cgit v1.2.3