From ff44e1ea457be258d5023a1f7be7e5610979530a Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Fri, 3 Aug 2007 10:21:59 +0000 Subject: [PATCH] Improve calculation of new buffer size svn path=/trunk/; revision=28121 --- reactos/lib/inflib/infput.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/lib/inflib/infput.c b/reactos/lib/inflib/infput.c index 70c9024d4e8..78567b836bf 100644 --- a/reactos/lib/inflib/infput.c +++ b/reactos/lib/inflib/infput.c @@ -43,8 +43,8 @@ Output(POUTPUTBUFFER OutBuf, PCTSTR Text) DPRINT("Out of free space. TotalSize %lu FreeSize %lu Length %u\n", OutBuf->TotalSize, OutBuf->FreeSize, Length); /* Round up to next SIZE_INC */ - NewSize = OutBuf->TotalSize + - (((Length + 1) - OutBuf->FreeSize + (SIZE_INC - 1)) / + NewSize = OutBuf->TotalSize - OutBuf->FreeSize + + (((Length + 1) + (SIZE_INC - 1)) / SIZE_INC) * SIZE_INC; DPRINT("NewSize %lu\n", NewSize); NewBuf = MALLOC(NewSize);