Return the full string when requested from a flatbuffers::String, even if it contains a NULL byte.

This commit is contained in:
Chris 2015-11-27 20:05:48 +00:00 committed by Wouter van Oortmerssen
parent d7b4a31e93
commit 671c9495d9
1 changed files with 1 additions and 1 deletions

View File

@ -379,7 +379,7 @@ template<typename T> static inline size_t VectorLength(const Vector<T> *v) {
struct String : public Vector<char> {
const char *c_str() const { return reinterpret_cast<const char *>(Data()); }
std::string str() const { return c_str(); }
std::string str() const { return std::string(c_str(), Length()); }
bool operator <(const String &o) const {
return strcmp(c_str(), o.c_str()) < 0;