Skip to content

Commit 7fb2164

Browse files
author
Maurice Ling
committed
Fix uninitialized constructor values
1 parent 63a961a commit 7fb2164

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/lib_json/json_reader.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,8 @@ OurFeatures::OurFeatures()
905905
, allowDroppedNullPlaceholders_(false), allowNumericKeys_(false)
906906
, allowSingleQuotes_(false)
907907
, failIfExtra_(false)
908+
, rejectDupKeys_(false)
909+
, stackLimit_(1000)
908910
{
909911
}
910912

@@ -1032,7 +1034,7 @@ class OurReader {
10321034

10331035
OurReader::OurReader(OurFeatures const& features)
10341036
: errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(),
1035-
lastValue_(), commentsBefore_(), features_(features), collectComments_() {
1037+
lastValue_(), commentsBefore_(), stackDepth_(0), features_(features), collectComments_() {
10361038
}
10371039

10381040
bool OurReader::parse(const char* beginDoc,

src/lib_json/json_writer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ bool StyledWriter::hasCommentForValue(const Value& value) {
585585

586586
StyledStreamWriter::StyledStreamWriter(std::string indentation)
587587
: document_(NULL), rightMargin_(74), indentation_(indentation),
588+
indented_(true),
588589
addChildValues_() {}
589590

590591
void StyledStreamWriter::write(std::ostream& out, const Value& root) {

0 commit comments

Comments
 (0)