Skip to content

Commit

Permalink
Trivial fixes in CZString constructors.
Browse files Browse the repository at this point in the history
  • Loading branch information
datadiode authored and cdunn2001 committed Mar 7, 2015
1 parent 5c44868 commit ee83f88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib_json/json_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,15 @@ void Value::CommentInfo::setComment(const char* text, size_t len) {
Value::CZString::CZString(ArrayIndex index) : cstr_(0), index_(index) {}

Value::CZString::CZString(char const* str, unsigned length, DuplicationPolicy allocate)
: cstr_(allocate == duplicate ? duplicateStringValue(str) : str)
: cstr_(allocate == duplicate ? duplicateStringValue(str, length) : str)
{
storage_.policy_ = allocate;
storage_.length_ = length;
}

Value::CZString::CZString(const CZString& other)
: cstr_(other.storage_.policy_ != noDuplication && other.cstr_ != 0
? duplicateStringValue(other.cstr_)
? duplicateStringValue(other.cstr_, other.storage_.length_)
: other.cstr_)
{
storage_.policy_ = (other.cstr_
Expand Down

0 comments on commit ee83f88

Please sign in to comment.