From 85a263e89f132f26812f8f468b146fb8b8690063 Mon Sep 17 00:00:00 2001 From: Marian Klymov Date: Sat, 2 Jun 2018 19:38:12 +0300 Subject: [PATCH 1/8] Fix improper format specifier in printf %d in format string requires 'int' but the argument type is 'unsigned int'. --- src/jsontestrunner/main.cpp | 4 ++-- src/test_lib_json/jsontest.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/jsontestrunner/main.cpp b/src/jsontestrunner/main.cpp index 7105b39..54ca302 100644 --- a/src/jsontestrunner/main.cpp +++ b/src/jsontestrunner/main.cpp @@ -106,9 +106,9 @@ static void printValueTree(FILE* fout, for (Json::ArrayIndex index = 0; index < size; ++index) { static char buffer[16]; #if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) - sprintf_s(buffer, sizeof(buffer), "[%d]", index); + sprintf_s(buffer, sizeof(buffer), "[%u]", index); #else - snprintf(buffer, sizeof(buffer), "[%d]", index); + snprintf(buffer, sizeof(buffer), "[%u]", index); #endif printValueTree(fout, value[index], path + buffer); } diff --git a/src/test_lib_json/jsontest.cpp b/src/test_lib_json/jsontest.cpp index 7ca58c3..ce23800 100644 --- a/src/test_lib_json/jsontest.cpp +++ b/src/test_lib_json/jsontest.cpp @@ -165,7 +165,7 @@ void TestResult::printFailure(bool printTestName) const { const Failure& failure = *it; JSONCPP_STRING indent(failure.nestingLevel_ * 2, ' '); if (failure.file_) { - printf("%s%s(%d): ", indent.c_str(), failure.file_, failure.line_); + printf("%s%s(%u): ", indent.c_str(), failure.file_, failure.line_); } if (!failure.expr_.empty()) { printf("%s\n", failure.expr_.c_str()); @@ -281,7 +281,7 @@ bool Runner::runAllTest(bool printSummary) const { if (failures.empty()) { if (printSummary) { - printf("All %d tests passed\n", count); + printf("All %u tests passed\n", count); } return true; } else { @@ -293,7 +293,7 @@ bool Runner::runAllTest(bool printSummary) const { if (printSummary) { unsigned int failedCount = static_cast(failures.size()); unsigned int passedCount = count - failedCount; - printf("%d/%d tests passed (%d failure(s))\n", passedCount, count, + printf("%u/%u tests passed (%u failure(s))\n", passedCount, count, failedCount); } return false; From c8bb600d2729d2588e9af9d6d4a95ff0f59f63dc Mon Sep 17 00:00:00 2001 From: Marian Klymov Date: Sat, 2 Jun 2018 19:41:57 +0300 Subject: [PATCH 2/8] Pass string as a const reference. --- include/json/writer.h | 2 +- src/lib_json/json_writer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/json/writer.h b/include/json/writer.h index 30424b0..7c9ae21 100644 --- a/include/json/writer.h +++ b/include/json/writer.h @@ -300,7 +300,7 @@ public: /** * \param indentation Each level will be indented by this amount extra. */ - StyledStreamWriter(JSONCPP_STRING indentation = "\t"); + StyledStreamWriter(const JSONCPP_STRING& indentation = "\t"); ~StyledStreamWriter() {} public: diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index 95e7b1c..e0e47ad 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -643,7 +643,7 @@ bool StyledWriter::hasCommentForValue(const Value& value) { // Class StyledStreamWriter // ////////////////////////////////////////////////////////////////// -StyledStreamWriter::StyledStreamWriter(JSONCPP_STRING indentation) +StyledStreamWriter::StyledStreamWriter(const JSONCPP_STRING& indentation) : document_(NULL), rightMargin_(74), indentation_(indentation), addChildValues_(), indented_(false) {} From 48112c8b626d3930ca748328189955219b81aad0 Mon Sep 17 00:00:00 2001 From: Marian Klymov Date: Sat, 2 Jun 2018 19:43:31 +0300 Subject: [PATCH 3/8] Make several methods static. --- include/json/value.h | 2 +- include/json/writer.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/json/value.h b/include/json/value.h index 06a6c0c..b94aeec 100644 --- a/include/json/value.h +++ b/include/json/value.h @@ -720,7 +720,7 @@ private: const InArgs& in, InArgs::const_iterator& itInArg, PathArgument::Kind kind); - void invalidPath(const JSONCPP_STRING& path, int location); + static void invalidPath(const JSONCPP_STRING& path, int location); Args args_; }; diff --git a/include/json/writer.h b/include/json/writer.h index 7c9ae21..c92d26b 100644 --- a/include/json/writer.h +++ b/include/json/writer.h @@ -249,7 +249,7 @@ private: void unindent(); void writeCommentBeforeValue(const Value& root); void writeCommentAfterValueOnSameLine(const Value& root); - bool hasCommentForValue(const Value& value); + static bool hasCommentForValue(const Value& value); static JSONCPP_STRING normalizeEOL(const JSONCPP_STRING& text); typedef std::vector ChildValues; @@ -323,7 +323,7 @@ private: void unindent(); void writeCommentBeforeValue(const Value& root); void writeCommentAfterValueOnSameLine(const Value& root); - bool hasCommentForValue(const Value& value); + static bool hasCommentForValue(const Value& value); static JSONCPP_STRING normalizeEOL(const JSONCPP_STRING& text); typedef std::vector ChildValues; From a7d0ffc7175c6ee7f1fa937cca5601722b96701e Mon Sep 17 00:00:00 2001 From: Marian Klymov Date: Sat, 2 Jun 2018 19:46:16 +0300 Subject: [PATCH 4/8] Remove unused private function in TestResult class --- src/test_lib_json/jsontest.cpp | 10 ---------- src/test_lib_json/jsontest.h | 1 - 2 files changed, 11 deletions(-) diff --git a/src/test_lib_json/jsontest.cpp b/src/test_lib_json/jsontest.cpp index ce23800..86ed4c1 100644 --- a/src/test_lib_json/jsontest.cpp +++ b/src/test_lib_json/jsontest.cpp @@ -140,16 +140,6 @@ TestResult& TestResult::popPredicateContext() { bool TestResult::failed() const { return !failures_.empty(); } -unsigned int TestResult::getAssertionNestingLevel() const { - unsigned int level = 0; - const PredicateContext* lastNode = &rootPredicateNode_; - while (lastNode->next_ != 0) { - lastNode = lastNode->next_; - ++level; - } - return level; -} - void TestResult::printFailure(bool printTestName) const { if (failures_.empty()) { return; diff --git a/src/test_lib_json/jsontest.h b/src/test_lib_json/jsontest.h index 6288d5b..9d50e90 100644 --- a/src/test_lib_json/jsontest.h +++ b/src/test_lib_json/jsontest.h @@ -97,7 +97,6 @@ public: private: TestResult& addToLastFailure(const JSONCPP_STRING& message); - unsigned int getAssertionNestingLevel() const; /// Adds a failure or a predicate context void addFailureInfo(const char* file, unsigned int line, From 091e03979d9331702e09cef61472159b8b1556b1 Mon Sep 17 00:00:00 2001 From: Marian Klymov Date: Sat, 2 Jun 2018 19:48:10 +0300 Subject: [PATCH 5/8] Reduce scope of variable. --- src/lib_json/json_reader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index 0bef78e..58a1b9a 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -706,8 +706,8 @@ bool Reader::decodeUnicodeCodePoint(Token& token, return addError( "additional six characters expected to parse unicode surrogate pair.", token, current); - unsigned int surrogatePair; if (*(current++) == '\\' && *(current++) == 'u') { + unsigned int surrogatePair; if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) { unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF); } else @@ -1726,8 +1726,8 @@ bool OurReader::decodeUnicodeCodePoint(Token& token, return addError( "additional six characters expected to parse unicode surrogate pair.", token, current); - unsigned int surrogatePair; if (*(current++) == '\\' && *(current++) == 'u') { + unsigned int surrogatePair; if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) { unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF); } else From fc20134c92770fe60db522e0c10c2d6c264f7b50 Mon Sep 17 00:00:00 2001 From: Marian Klymov Date: Sat, 2 Jun 2018 20:15:26 +0300 Subject: [PATCH 6/8] Fix different names for parameters in declaration and definition --- include/json/value.h | 10 ++++---- src/lib_json/json_reader.cpp | 50 ++++++++++++++++++------------------ src/lib_json/json_value.cpp | 48 +++++++++++++++++----------------- src/lib_json/json_writer.cpp | 4 +-- src/test_lib_json/jsontest.h | 2 +- 5 files changed, 57 insertions(+), 57 deletions(-) diff --git a/include/json/value.h b/include/json/value.h index b94aeec..8a0054c 100644 --- a/include/json/value.h +++ b/include/json/value.h @@ -427,12 +427,12 @@ Json::Value obj_value(Json::objectValue); // {} /// \post type() is unchanged void clear(); - /// Resize the array to size elements. + /// Resize the array to newSize elements. /// New elements are initialized to null. /// May only be called on nullValue or arrayValue. /// \pre type() is arrayValue or nullValue /// \post type() is arrayValue - void resize(ArrayIndex size); + void resize(ArrayIndex newSize); /// Access an array element (zero based index ). /// If the array contains less than index element, then null value are @@ -562,10 +562,10 @@ Json::Value obj_value(Json::objectValue); // {} /** \brief Remove the indexed array element. O(n) expensive operations. - Update 'removed' iff removed. - \return true iff removed (no exceptions) + Update 'removed' if removed. + \return true if removed (no exceptions) */ - bool removeIndex(ArrayIndex i, Value* removed); + bool removeIndex(ArrayIndex index, Value* removed); /// Return true if the object has a member named key. /// \note 'key' must be null-terminated. diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index 58a1b9a..7628e71 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -112,8 +112,8 @@ bool Reader::parse(const std::string& document, return parse(begin, end, root, collectComments); } -bool Reader::parse(std::istream& sin, Value& root, bool collectComments) { - // std::istream_iterator begin(sin); +bool Reader::parse(std::istream& is, Value& root, bool collectComments) { + // std::istream_iterator begin(is); // std::istream_iterator end; // Those would allow streamed input from a file, if parse() were a // template function. @@ -121,7 +121,7 @@ bool Reader::parse(std::istream& sin, Value& root, bool collectComments) { // Since JSONCPP_STRING is reference-counted, this at least does not // create an extra copy. JSONCPP_STRING doc; - std::getline(sin, doc, (char)EOF); + std::getline(is, doc, (char)EOF); return parse(doc.data(), doc.data() + doc.size(), root, collectComments); } @@ -460,12 +460,12 @@ bool Reader::readString() { return c == '"'; } -bool Reader::readObject(Token& tokenStart) { +bool Reader::readObject(Token& token) { Token tokenName; JSONCPP_STRING name; Value init(objectValue); currentValue().swapPayload(init); - currentValue().setOffsetStart(tokenStart.start_ - begin_); + currentValue().setOffsetStart(token.start_ - begin_); while (readToken(tokenName)) { bool initialTokenOk = true; while (tokenName.type_ == tokenComment && initialTokenOk) @@ -516,10 +516,10 @@ bool Reader::readObject(Token& tokenStart) { tokenObjectEnd); } -bool Reader::readArray(Token& tokenStart) { +bool Reader::readArray(Token& token) { Value init(arrayValue); currentValue().swapPayload(init); - currentValue().setOffsetStart(tokenStart.start_ - begin_); + currentValue().setOffsetStart(token.start_ - begin_); skipSpaces(); if (current_ != end_ && *current_ == ']') // empty array { @@ -536,19 +536,19 @@ bool Reader::readArray(Token& tokenStart) { if (!ok) // error already set return recoverFromError(tokenArrayEnd); - Token token; + Token currentToken; // Accept Comment after last item in the array. - ok = readToken(token); - while (token.type_ == tokenComment && ok) { - ok = readToken(token); + ok = readToken(currentToken); + while (currentToken.type_ == tokenComment && ok) { + ok = readToken(currentToken); } bool badTokenType = - (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd); + (currentToken.type_ != tokenArraySeparator && currentToken.type_ != tokenArrayEnd); if (!ok || badTokenType) { return addErrorAndRecover("Missing ',' or ']' in array declaration", - token, tokenArrayEnd); + currentToken, tokenArrayEnd); } - if (token.type_ == tokenArrayEnd) + if (currentToken.type_ == tokenArrayEnd) break; } return true; @@ -1450,12 +1450,12 @@ bool OurReader::readStringSingleQuote() { return c == '\''; } -bool OurReader::readObject(Token& tokenStart) { +bool OurReader::readObject(Token& token) { Token tokenName; JSONCPP_STRING name; Value init(objectValue); currentValue().swapPayload(init); - currentValue().setOffsetStart(tokenStart.start_ - begin_); + currentValue().setOffsetStart(token.start_ - begin_); while (readToken(tokenName)) { bool initialTokenOk = true; while (tokenName.type_ == tokenComment && initialTokenOk) @@ -1512,10 +1512,10 @@ bool OurReader::readObject(Token& tokenStart) { tokenObjectEnd); } -bool OurReader::readArray(Token& tokenStart) { +bool OurReader::readArray(Token& token) { Value init(arrayValue); currentValue().swapPayload(init); - currentValue().setOffsetStart(tokenStart.start_ - begin_); + currentValue().setOffsetStart(token.start_ - begin_); skipSpaces(); if (current_ != end_ && *current_ == ']') // empty array { @@ -1532,19 +1532,19 @@ bool OurReader::readArray(Token& tokenStart) { if (!ok) // error already set return recoverFromError(tokenArrayEnd); - Token token; + Token currentToken; // Accept Comment after last item in the array. - ok = readToken(token); - while (token.type_ == tokenComment && ok) { - ok = readToken(token); + ok = readToken(currentToken); + while (currentToken.type_ == tokenComment && ok) { + ok = readToken(currentToken); } bool badTokenType = - (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd); + (currentToken.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd); if (!ok || badTokenType) { return addErrorAndRecover("Missing ',' or ']' in array declaration", - token, tokenArrayEnd); + currentToken, tokenArrayEnd); } - if (token.type_ == tokenArrayEnd) + if (currentToken.type_ == tokenArrayEnd) break; } return true; diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp index 6bf981e..1160c22 100644 --- a/src/lib_json/json_value.cpp +++ b/src/lib_json/json_value.cpp @@ -241,15 +241,15 @@ void Value::CommentInfo::setComment(const char* text, size_t len) { // Notes: policy_ indicates if the string was allocated when // a string is stored. -Value::CZString::CZString(ArrayIndex aindex) : cstr_(0), index_(aindex) {} +Value::CZString::CZString(ArrayIndex index) : cstr_(0), index_(index) {} Value::CZString::CZString(char const* str, - unsigned ulength, + unsigned length, DuplicationPolicy allocate) : cstr_(str) { // allocate != duplicate storage_.policy_ = allocate & 0x3; - storage_.length_ = ulength & 0x3FFFFFFF; + storage_.length_ = length & 0x3FFFFFFF; } Value::CZString::CZString(const CZString& other) { @@ -357,10 +357,10 @@ bool Value::CZString::isStaticString() const { * memset( this, 0, sizeof(Value) ) * This optimization is used in ValueInternalMap fast allocator. */ -Value::Value(ValueType vtype) { +Value::Value(ValueType type) { static char const emptyString[] = ""; - initBasic(vtype); - switch (vtype) { + initBasic(type); + switch (type) { case nullValue: break; case intValue: @@ -418,10 +418,10 @@ Value::Value(const char* value) { value, static_cast(strlen(value))); } -Value::Value(const char* beginValue, const char* endValue) { +Value::Value(const char* begin, const char* end) { initBasic(stringValue, true); value_.string_ = duplicateAndPrefixStringValue( - beginValue, static_cast(endValue - beginValue)); + begin, static_cast(end - begin)); } Value::Value(const JSONCPP_STRING& value) { @@ -645,14 +645,14 @@ unsigned Value::getCStringLength() const { } #endif -bool Value::getString(char const** str, char const** cend) const { +bool Value::getString(char const** begin, char const** end) const { if (type_ != stringValue) return false; if (value_.string_ == 0) return false; unsigned length; - decodePrefixedString(this->allocated_, this->value_.string_, &length, str); - *cend = *str + length; + decodePrefixedString(this->allocated_, this->value_.string_, &length, begin); + *end = *begin + length; return true; } @@ -1003,8 +1003,8 @@ const Value& Value::operator[](int index) const { return (*this)[ArrayIndex(index)]; } -void Value::initBasic(ValueType vtype, bool allocated) { - type_ = vtype; +void Value::initBasic(ValueType type, bool allocated) { + type_ = type; allocated_ = allocated; comments_ = 0; start_ = 0; @@ -1101,13 +1101,13 @@ Value& Value::resolveReference(const char* key) { } // @param key is not null-terminated. -Value& Value::resolveReference(char const* key, char const* cend) { +Value& Value::resolveReference(char const* key, char const* end) { JSON_ASSERT_MESSAGE( type_ == nullValue || type_ == objectValue, "in Json::Value::resolveReference(key, end): requires objectValue"); if (type_ == nullValue) *this = Value(objectValue); - CZString actualKey(key, static_cast(cend - key), + CZString actualKey(key, static_cast(end - key), CZString::duplicateOnCopy); ObjectValues::iterator it = value_.map_->lower_bound(actualKey); if (it != value_.map_->end() && (*it).first == actualKey) @@ -1126,13 +1126,13 @@ Value Value::get(ArrayIndex index, const Value& defaultValue) const { bool Value::isValidIndex(ArrayIndex index) const { return index < size(); } -Value const* Value::find(char const* key, char const* cend) const { +Value const* Value::find(char const* begin, char const* end) const { JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == objectValue, "in Json::Value::find(key, end, found): requires " "objectValue or nullValue"); if (type_ == nullValue) return NULL; - CZString actualKey(key, static_cast(cend - key), + CZString actualKey(begin, static_cast(end - begin), CZString::noDuplication); ObjectValues::const_iterator it = value_.map_->find(actualKey); if (it == value_.map_->end()) @@ -1184,10 +1184,10 @@ Value& Value::append(Value&& value) { } #endif -Value Value::get(char const* key, - char const* cend, +Value Value::get(char const* begin, + char const* end, Value const& defaultValue) const { - Value const* found = find(key, cend); + Value const* found = find(begin, end); return !found ? defaultValue : *found; } Value Value::get(char const* key, Value const& defaultValue) const { @@ -1197,11 +1197,11 @@ Value Value::get(JSONCPP_STRING const& key, Value const& defaultValue) const { return get(key.data(), key.data() + key.length(), defaultValue); } -bool Value::removeMember(const char* key, const char* cend, Value* removed) { +bool Value::removeMember(const char* begin, const char* end, Value* removed) { if (type_ != objectValue) { return false; } - CZString actualKey(key, static_cast(cend - key), + CZString actualKey(begin, static_cast(end - begin), CZString::noDuplication); ObjectValues::iterator it = value_.map_->find(actualKey); if (it == value_.map_->end()) @@ -1264,8 +1264,8 @@ Value Value::get(const CppTL::ConstString& key, } #endif -bool Value::isMember(char const* key, char const* cend) const { - Value const* value = find(key, cend); +bool Value::isMember(char const* begin, char const* end) const { + Value const* value = find(begin, end); return NULL != value; } bool Value::isMember(char const* key) const { diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index e0e47ad..5eaa041 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -1245,10 +1245,10 @@ void StreamWriterBuilder::setDefaults(Json::Value* settings) { //! [StreamWriterBuilderDefaults] } -JSONCPP_STRING writeString(StreamWriter::Factory const& builder, +JSONCPP_STRING writeString(StreamWriter::Factory const& factory, Value const& root) { JSONCPP_OSTRINGSTREAM sout; - StreamWriterPtr const writer(builder.newStreamWriter()); + StreamWriterPtr const writer(factory.newStreamWriter()); writer->write(root, &sout); return sout.str(); } diff --git a/src/test_lib_json/jsontest.h b/src/test_lib_json/jsontest.h index 9d50e90..9aab538 100644 --- a/src/test_lib_json/jsontest.h +++ b/src/test_lib_json/jsontest.h @@ -167,7 +167,7 @@ private: // prevents copy construction and assignment private: void listTests() const; - bool testIndex(const JSONCPP_STRING& testName, unsigned int& index) const; + bool testIndex(const JSONCPP_STRING& testName, unsigned int& indexOut) const; static void preventDialogOnCrash(); private: From 84ca7d6f0bf3148124c0dcb309cb477cd027324e Mon Sep 17 00:00:00 2001 From: Marian Klymov Date: Sat, 2 Jun 2018 20:27:31 +0300 Subject: [PATCH 7/8] Apply the formatting specified in .clang-format file. --- src/lib_json/json_reader.cpp | 8 ++++---- src/lib_json/json_value.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index 7628e71..09aeba9 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -542,8 +542,8 @@ bool Reader::readArray(Token& token) { while (currentToken.type_ == tokenComment && ok) { ok = readToken(currentToken); } - bool badTokenType = - (currentToken.type_ != tokenArraySeparator && currentToken.type_ != tokenArrayEnd); + bool badTokenType = (currentToken.type_ != tokenArraySeparator && + currentToken.type_ != tokenArrayEnd); if (!ok || badTokenType) { return addErrorAndRecover("Missing ',' or ']' in array declaration", currentToken, tokenArrayEnd); @@ -1538,8 +1538,8 @@ bool OurReader::readArray(Token& token) { while (currentToken.type_ == tokenComment && ok) { ok = readToken(currentToken); } - bool badTokenType = - (currentToken.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd); + bool badTokenType = (currentToken.type_ != tokenArraySeparator && + token.type_ != tokenArrayEnd); if (!ok || badTokenType) { return addErrorAndRecover("Missing ',' or ']' in array declaration", currentToken, tokenArrayEnd); diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp index 1160c22..cc5e8fe 100644 --- a/src/lib_json/json_value.cpp +++ b/src/lib_json/json_value.cpp @@ -420,8 +420,8 @@ Value::Value(const char* value) { Value::Value(const char* begin, const char* end) { initBasic(stringValue, true); - value_.string_ = duplicateAndPrefixStringValue( - begin, static_cast(end - begin)); + value_.string_ = + duplicateAndPrefixStringValue(begin, static_cast(end - begin)); } Value::Value(const JSONCPP_STRING& value) { From a5d7c714b1ecdd7ad2a15378f70512384acdafcb Mon Sep 17 00:00:00 2001 From: Marian Klymov Date: Sat, 2 Jun 2018 21:52:45 +0300 Subject: [PATCH 8/8] Fix typo in previous fix. --- src/lib_json/json_reader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index 09aeba9..3e58f44 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -1539,7 +1539,7 @@ bool OurReader::readArray(Token& token) { ok = readToken(currentToken); } bool badTokenType = (currentToken.type_ != tokenArraySeparator && - token.type_ != tokenArrayEnd); + currentToken.type_ != tokenArrayEnd); if (!ok || badTokenType) { return addErrorAndRecover("Missing ',' or ']' in array declaration", currentToken, tokenArrayEnd);