summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 47930ac)
raw | patch | inline | side by side (parent: 47930ac)
author | fgsfds <pvt.fgsfds@gmail.com> | |
Sun, 1 Sep 2019 18:38:22 +0000 (21:38 +0300) | ||
committer | fgsfds <pvt.fgsfds@gmail.com> | |
Sun, 1 Sep 2019 18:38:22 +0000 (21:38 +0300) |
src/engine/e_msg.pas | patch | blob | history |
diff --git a/src/engine/e_msg.pas b/src/engine/e_msg.pas
index bb7347740bd950401a0bfc4d49626b41c6884069..7e976e87d38b00fecd761ba2b1175b39a32833f0 100644 (file)
--- a/src/engine/e_msg.pas
+++ b/src/engine/e_msg.pas
begin
if OwnMemory then
begin
- NewSize := MaxSize + ((N + AllocStep) div AllocStep) * AllocStep; // round up
+ NewSize := MaxSize + ((N + AllocStep - 1) div AllocStep) * AllocStep; // round up
if ReAllocMem(Data, NewSize) = nil then
raise Exception.Create('TMsg.WriteData: out of memory on realloc');
MaxSize := NewSize;