Simran Singhal <singhalsimr...@gmail.com> writes: > Change the "parser->bracket_count >= 0" to "parser->brace_count >= 0" > to fix the typo. > > Fixes: 8d3265b3 > > Reviewed-by: Eric Blake <ebl...@redhat.com> > Signed-off-by: Simran Singhal <singhalsimr...@gmail.com>
First, thank you so much for spotting and fixing my typo! The commit message neglects to explain what is broken. I'd like to use this one: json: Fix check for unbalanced right curly brace We immediately diagnose unbalanced right curly brace: $ qemu-kvm --nodefaults --nographic --qmp stdio {"QMP": {"version": {"qemu": {"micro": 91, "minor": 2, "major": 4}, "package": "v5.0.0-rc1-1-gf6ce4a439a08"}, "capabilities": ["oob"]}} } {"error": {"class": "GenericError", "desc": "JSON parse error, expecting value"}} except within square bracket: [} The check for unbalanced braces has a typo. Fix it. Fixes: 8d3265b3d00db1071d1d3bf8433b4818088fdeb5 Signed-off-by: Simran Singhal <singhalsimr...@gmail.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Objections? > --- > Changes in v3: > -Add "Fixes: 8d3265b3" in commit message. > > Changes in v2: > -No need to remove the duplicate occurrence of "parser->bracket_count > >= 0" > but actually it is a typo and one occurence should be > "parser->brace_count >= 0". > > qobject/json-streamer.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/qobject/json-streamer.c b/qobject/json-streamer.c > index 47dd7ea576..b93d97b995 100644 > --- a/qobject/json-streamer.c > +++ b/qobject/json-streamer.c > @@ -85,7 +85,7 @@ void json_message_process_token(JSONLexer *lexer, GString > *input, > g_queue_push_tail(&parser->tokens, token); > > if ((parser->brace_count > 0 || parser->bracket_count > 0) > - && parser->bracket_count >= 0 && parser->bracket_count >= 0) { > + && parser->brace_count >= 0 && parser->bracket_count >= 0) { > return; > } With a commit message that spells out what's broken: Reviewed-by: Markus Armbruster <arm...@redhat.com>