Skip to content

Commit 126bdc2

Browse files
committed
Reject extra chars if strictRoot
resolves #511
1 parent 094a7d8 commit 126bdc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib_json/json_reader.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ bool OurReader::parse(const char* beginDoc,
10681068
Token token;
10691069
skipCommentTokens(token);
10701070
if (features_.failIfExtra_) {
1071-
if (token.type_ != tokenError && token.type_ != tokenEndOfStream) {
1071+
if ((features_.strictRoot_ || token.type_ != tokenError) && token.type_ != tokenEndOfStream) {
10721072
addError("Extra non-whitespace after JSON value.", token);
10731073
return false;
10741074
}

0 commit comments

Comments
 (0)