allow 0-length allocs without complaint (required when vfs_loading 0-length files, as happens with current art pack)
This was SVN commit r1258.
This commit is contained in:
parent
3c9823fd31
commit
8764693bd8
@ -320,11 +320,10 @@ void* mem_alloc(size_t size, const size_t align, uint flags, Handle* phm)
|
||||
if(phm)
|
||||
*phm = ERR_NO_MEM;
|
||||
|
||||
// note: this is legitimate. vfs_load on 0-length files must return
|
||||
// a valid and unique pointer to an (at least) 0-length buffer.
|
||||
if(size == 0)
|
||||
{
|
||||
debug_warn("mem_alloc: why is size = 0?");
|
||||
size = 1;
|
||||
}
|
||||
|
||||
// no scope indicated
|
||||
if(!flags)
|
||||
|
Loading…
Reference in New Issue
Block a user