parent
3f41b87e8d
commit
5912c6e6f0
|
@ -792,7 +792,7 @@ RopePiece RewriteRope::MakeRopeString(const char *Start, const char *End) {
|
|||
if (AllocBuffer && --AllocBuffer->RefCount == 0)
|
||||
delete [] (char*)AllocBuffer;
|
||||
|
||||
unsigned AllocSize = sizeof(RopeRefCountString)-1+AllocChunkSize;
|
||||
unsigned AllocSize = offsetof(RopeRefCountString, Data) + AllocChunkSize;
|
||||
AllocBuffer = reinterpret_cast<RopeRefCountString *>(new char[AllocSize]);
|
||||
AllocBuffer->RefCount = 0;
|
||||
memcpy(AllocBuffer->Data, Start, Len);
|
||||
|
|
Loading…
Reference in New Issue