From: fgsfds Date: Sun, 1 Sep 2019 18:38:22 +0000 (+0300) Subject: fix round up X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=1213aecb7e95da674a8c7032457f109a4db2e1c8;p=d2df-sdl.git fix round up --- diff --git a/src/engine/e_msg.pas b/src/engine/e_msg.pas index bb73477..7e976e8 100644 --- a/src/engine/e_msg.pas +++ b/src/engine/e_msg.pas @@ -150,7 +150,7 @@ begin 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;