diff options
author | yiteng.nyt <yiteng.nyt@alibaba-inc.com> | 2016-07-11 07:38:10 +0300 |
---|---|---|
committer | yiteng.nyt <yiteng.nyt@alibaba-inc.com> | 2016-07-11 07:38:10 +0300 |
commit | 8c43554de6c7af90463852c2c59deca67cc1415f (patch) | |
tree | 619695ff1168f33017c8745b9b40062789ea6c33 /include/rapidjson/document.h | |
parent | 5e8a382c1978d3546349386063723cb713dbfcf9 (diff) |
fix rapidjson::value::Get<std::string>() may returns wrong data
Change-Id: Ia7325edb437e3039e29223d0ecc4d9c83d824bc0
Diffstat (limited to 'include/rapidjson/document.h')
-rw-r--r-- | include/rapidjson/document.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 17af9226..783479cb 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -480,7 +480,7 @@ template<typename ValueType> struct TypeHelper<ValueType, std::basic_string<typename ValueType::Ch> > { typedef std::basic_string<typename ValueType::Ch> StringType; static bool Is(const ValueType& v) { return v.IsString(); } - static StringType Get(const ValueType& v) { return v.GetString(); } + static StringType Get(const ValueType& v) { return StringType(v.GetString(), v.GetStringLength()); } static ValueType& Set(ValueType& v, const StringType& data, typename ValueType::AllocatorType& a) { return v.SetString(data, a); } }; #endif |