Commit cea5a720 authored by Gildas Bazin's avatar Gildas Bazin

* src/misc/block.c: fixed block_Realloc()

parent a2c3ce44
......@@ -100,9 +100,9 @@ block_t *block_Realloc( block_t *p_block, int i_prebody, int i_body )
if( i_body < 0 || i_buffer_size <= 0 ) return NULL;
if( i_prebody < ( p_block->p_buffer - p_block->p_sys->p_allocated_buffer +
p_block->p_sys->i_allocated_buffer ) ||
p_block->p_buffer - i_prebody > p_block->p_sys->p_allocated_buffer )
if( p_block->p_buffer - i_prebody > p_block->p_sys->p_allocated_buffer &&
p_block->p_buffer - i_prebody < p_block->p_sys->p_allocated_buffer +
p_block->p_sys->i_allocated_buffer )
{
p_block->p_buffer -= i_prebody;
p_block->i_buffer += i_prebody;
......
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