mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
make sure that SDL_malloc(0) or SDL_calloc(0,x) doesn't return NULL.
This commit is contained in:
parent
0ce23a5498
commit
bef0fec121
@ -33,11 +33,17 @@
|
||||
|
||||
void *SDL_malloc(size_t size)
|
||||
{
|
||||
if (!size) {
|
||||
return malloc(1);
|
||||
}
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void *SDL_calloc(size_t nmemb, size_t size)
|
||||
{
|
||||
if (!size || !nmemb) {
|
||||
return calloc(1,1);
|
||||
}
|
||||
return calloc(nmemb, size);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user