Commit f929cfca authored by Lee Shallis's avatar Lee Shallis
Browse files

Crash was being caused by a variable not holding the value it was

expected to be doing so after I re-used it forgetting about the later
use, adding in a new variable to hold the value I re-used it for
resolved the issue.
parent 8847606d
......@@ -218,7 +218,7 @@ int ObtainSpare( SERIES *Series, int *spare, int size, int add )
int ObtainBlock( BLOCKS *Blocks, int *block, size_t want )
{
int err, i, num = Blocks->Using.Used.abs;
int err, i, add = 32, num = Blocks->Using.Used.abs;
uchar *active = Blocks->Using.Block.addr;
BLOCK *blocks = Blocks->Block.addr, *Block;
BIT pos;
......@@ -251,11 +251,9 @@ int ObtainBlock( BLOCKS *Blocks, int *block, size_t want )
goto done;
}
num = 32;
if ( i % num == 0 || i > Blocks->Block.have )
if ( i % add == 0 || i > Blocks->Block.have )
{
blocks = ExpandSeries( Blocks, sizeof(BLOCK), i + num );
blocks = ExpandSeries( Blocks, sizeof(BLOCK), i + add );
if ( !blocks )
return ENOMEM;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment