Skip to content

Commit

Permalink
fix rapidjson::value::Get<std::string>() may returns wrong data
Browse files Browse the repository at this point in the history
Change-Id: Ia7325edb437e3039e29223d0ecc4d9c83d824bc0
  • Loading branch information
niukuo committed Jul 11, 2016
1 parent 5e8a382 commit 8c43554
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/rapidjson/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8c43554

Please sign in to comment.