mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 13:45:58 +00:00
Improve calculation of new buffer size
svn path=/trunk/; revision=28121
This commit is contained in:
parent
401e48338f
commit
ff44e1ea45
|
@ -43,8 +43,8 @@ Output(POUTPUTBUFFER OutBuf, PCTSTR Text)
|
||||||
DPRINT("Out of free space. TotalSize %lu FreeSize %lu Length %u\n",
|
DPRINT("Out of free space. TotalSize %lu FreeSize %lu Length %u\n",
|
||||||
OutBuf->TotalSize, OutBuf->FreeSize, Length);
|
OutBuf->TotalSize, OutBuf->FreeSize, Length);
|
||||||
/* Round up to next SIZE_INC */
|
/* Round up to next SIZE_INC */
|
||||||
NewSize = OutBuf->TotalSize +
|
NewSize = OutBuf->TotalSize - OutBuf->FreeSize +
|
||||||
(((Length + 1) - OutBuf->FreeSize + (SIZE_INC - 1)) /
|
(((Length + 1) + (SIZE_INC - 1)) /
|
||||||
SIZE_INC) * SIZE_INC;
|
SIZE_INC) * SIZE_INC;
|
||||||
DPRINT("NewSize %lu\n", NewSize);
|
DPRINT("NewSize %lu\n", NewSize);
|
||||||
NewBuf = MALLOC(NewSize);
|
NewBuf = MALLOC(NewSize);
|
||||||
|
|
Loading…
Reference in a new issue