mirror of
https://github.com/vee1e/flatbuffers.git
synced 2026-09-02 10:17:51 +00:00
Fixed AddFlatBuffer using wrong buffer length.
Also made the Xcode project link. Tested: on OS X.
This commit is contained in:
parent
7101224d86
commit
ad84b5b8fa
3 changed files with 20 additions and 99 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue