From a9f1050d9444c5f80ca9bc7e306a48e79ff9b6df Mon Sep 17 00:00:00 2001 From: lixianjing Date: Fri, 1 Dec 2023 09:48:58 +0800 Subject: [PATCH] improve json parser --- src/conf_io/conf_json.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/conf_io/conf_json.c b/src/conf_io/conf_json.c index 289bafec0f..82e52e6a38 100644 --- a/src/conf_io/conf_json.c +++ b/src/conf_io/conf_json.c @@ -128,8 +128,11 @@ static ret_t conf_json_parse_object(json_parser_t* parser) { if (c == '}') { parser->cursor++; break; - } else if (c != ',') { + } else if (c == ',') { + parser->cursor++; + } else { log_debug("unexpected char %c at %s\n", c, parser->data + parser->cursor); + parser->cursor++; } }