1
0
forked from 0ad/0ad

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:
janwas 2004-10-19 13:29:51 +00:00
parent 3c9823fd31
commit 8764693bd8

View File

@ -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)