From 7fb2164198247aa598dcd227294d747c7e5a07d8 Mon Sep 17 00:00:00 2001 From: Maurice Ling Date: Fri, 21 Aug 2015 15:09:24 -0700 Subject: [PATCH] Fix uninitialized constructor values --- src/lib_json/json_reader.cpp | 4 +++- src/lib_json/json_writer.cpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index 8d092737e..ecf3cee84 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -905,6 +905,8 @@ OurFeatures::OurFeatures() , allowDroppedNullPlaceholders_(false), allowNumericKeys_(false) , allowSingleQuotes_(false) , failIfExtra_(false) + , rejectDupKeys_(false) + , stackLimit_(1000) { } @@ -1032,7 +1034,7 @@ class OurReader { OurReader::OurReader(OurFeatures const& features) : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(), - lastValue_(), commentsBefore_(), features_(features), collectComments_() { + lastValue_(), commentsBefore_(), stackDepth_(0), features_(features), collectComments_() { } bool OurReader::parse(const char* beginDoc, diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index 89cd65131..d9b9a788e 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -585,6 +585,7 @@ bool StyledWriter::hasCommentForValue(const Value& value) { StyledStreamWriter::StyledStreamWriter(std::string indentation) : document_(NULL), rightMargin_(74), indentation_(indentation), + indented_(true), addChildValues_() {} void StyledStreamWriter::write(std::ostream& out, const Value& root) {