enhance toml_set_memutil to assign default

This commit is contained in:
CK Tan 2020-10-26 13:52:28 -07:00
parent 1901ac3166
commit 2e8feafae8

8
toml.c
View file

@ -46,10 +46,10 @@ void toml_set_memutil(void* (*xxmalloc)(size_t),
void* (*xxcalloc)(size_t, size_t),
void* (*xxrealloc)(void*, size_t))
{
ppmalloc = xxmalloc;
ppfree = xxfree;
ppcalloc = xxcalloc;
pprealloc = xxrealloc;
if (xxmalloc) ppmalloc = xxmalloc;
if (xxfree) ppfree = xxfree;
if (xxcalloc) ppcalloc = xxcalloc;
if (xxrealloc) pprealloc = xxrealloc;
}