mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
zone.c (Z_Realloc): If expanding size, zero-fill the expanded part
of the memory before returning, which is Z_Malloc() behavior. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@470 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
fcb71434b7
commit
3ea2addc76
1 changed files with 2 additions and 0 deletions
|
@ -238,6 +238,8 @@ void *Z_Realloc(void *ptr, int size)
|
|||
|
||||
if (ptr != old_ptr)
|
||||
memmove (ptr, old_ptr, q_min(old_size, size));
|
||||
if (old_size < size)
|
||||
memset ((byte *)ptr + old_size, 0, size - old_size);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue