mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-18 22:54:25 +01:00
common: add simple json parse wrapper for the complete cases.
We're going to change the API on the more complete JSON parser, so make and use a simple API for the easy cases. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -148,9 +148,8 @@ static struct json *json_parse(const tal_t * ctx, const char *str)
|
||||
struct json *j = tal(ctx, struct json);
|
||||
j->buffer = tal_strdup(j, str);
|
||||
convert_quotes(j->buffer);
|
||||
bool ok;
|
||||
j->toks = json_parse_input(j, j->buffer, strlen(j->buffer), &ok);
|
||||
assert(ok);
|
||||
j->toks = json_parse_simple(j, j->buffer, strlen(j->buffer));
|
||||
assert(j->toks);
|
||||
j->toks = json_tok_copy(j, j->toks);
|
||||
return j;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user