mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-31 06:23:02 +08:00
Trivial fixes in CZString constructors.
This commit is contained in:
parent
5c448687e1
commit
ee83f8891c
@ -196,7 +196,7 @@ void Value::CommentInfo::setComment(const char* text, size_t len) {
|
|||||||
Value::CZString::CZString(ArrayIndex index) : cstr_(0), index_(index) {}
|
Value::CZString::CZString(ArrayIndex index) : cstr_(0), index_(index) {}
|
||||||
|
|
||||||
Value::CZString::CZString(char const* str, unsigned length, DuplicationPolicy allocate)
|
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_.policy_ = allocate;
|
||||||
storage_.length_ = length;
|
storage_.length_ = length;
|
||||||
@ -204,7 +204,7 @@ Value::CZString::CZString(char const* str, unsigned length, DuplicationPolicy al
|
|||||||
|
|
||||||
Value::CZString::CZString(const CZString& other)
|
Value::CZString::CZString(const CZString& other)
|
||||||
: cstr_(other.storage_.policy_ != noDuplication && other.cstr_ != 0
|
: cstr_(other.storage_.policy_ != noDuplication && other.cstr_ != 0
|
||||||
? duplicateStringValue(other.cstr_)
|
? duplicateStringValue(other.cstr_, other.storage_.length_)
|
||||||
: other.cstr_)
|
: other.cstr_)
|
||||||
{
|
{
|
||||||
storage_.policy_ = (other.cstr_
|
storage_.policy_ = (other.cstr_
|
||||||
|
Loading…
x
Reference in New Issue
Block a user