Commit 671c9495 authored by Chris's avatar Chris Committed by Wouter van Oortmerssen

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

parent d7b4a31e
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment