mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-24 14:06:10 +00:00
Always add additional space if no more is available
Change-Id: If08b2d839489d40e977de794b13584fa66ff32c1
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
803f9bba27
commit
c4a3e2f6bd
@@ -198,7 +198,7 @@ func (b *Builder) Prep(size, additionalBytes int) {
|
||||
alignSize &= (size - 1)
|
||||
|
||||
// Reallocate the buffer if needed:
|
||||
for int(b.head) < alignSize+size+additionalBytes {
|
||||
for int(b.head) <= alignSize+size+additionalBytes {
|
||||
oldBufSize := len(b.Bytes)
|
||||
b.growByteBuffer()
|
||||
b.head += UOffsetT(len(b.Bytes) - oldBufSize)
|
||||
|
||||
Reference in New Issue
Block a user