Skip to content

Commit

Permalink
Merge pull request #681 from niukuo/master
Browse files Browse the repository at this point in the history
fix rapidjson::value::Get<std::string>() may returns wrong data
  • Loading branch information
miloyip authored Jul 11, 2016
2 parents 5e8a382 + 8c43554 commit 369de87
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 369de87

Please sign in to comment.