[ros-diffs] [weiden] 28121: Improve calculation of new buffer size
weiden at svn.reactos.org
weiden at svn.reactos.org
Fri Aug 3 12:22:00 CEST 2007
Author: weiden
Date: Fri Aug 3 14:21:59 2007
New Revision: 28121
URL: http://svn.reactos.org/svn/reactos?rev=28121&view=rev
Log:
Improve calculation of new buffer size
Modified:
trunk/reactos/lib/inflib/infput.c
Modified: trunk/reactos/lib/inflib/infput.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/inflib/infput.c?rev=28121&r1=28120&r2=28121&view=diff
==============================================================================
--- trunk/reactos/lib/inflib/infput.c (original)
+++ trunk/reactos/lib/inflib/infput.c Fri Aug 3 14:21:59 2007
@@ -43,8 +43,8 @@
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);
More information about the Ros-diffs
mailing list