Fixed AddFlatBuffer using wrong buffer length.

Also made the Xcode project link.

Tested: on OS X.
parent 7101224d
......@@ -334,8 +334,7 @@ const uint8_t *AddFlatBuffer(std::vector<uint8_t> &flatbuf,
}
auto insertion_point = static_cast<uoffset_t>(flatbuf.size());
// Insert the entire FlatBuffer minus the root pointer.
flatbuf.insert(flatbuf.end(), newbuf + sizeof(uoffset_t),
newbuf + newlen - sizeof(uoffset_t));
flatbuf.insert(flatbuf.end(), newbuf + sizeof(uoffset_t), newbuf + newlen);
auto root_offset = ReadScalar<uoffset_t>(newbuf) - sizeof(uoffset_t);
return flatbuf.data() + insertion_point + root_offset;
}
......
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