mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-11-12 16:50:37 +00:00
reformatting: cJSON_InitHooks
This commit is contained in:
1 parent
18081c03c4
commit
8db7e6d320
1 file changed
+5
-3
@@ -81,14 +81,16 @@ static char* cJSON_strdup(const char* str)
|
||||
|
||||
void cJSON_InitHooks(cJSON_Hooks* hooks)
|
||||
{
|
||||
if (!hooks) { /* Reset hooks */
|
||||
if (!hooks)
|
||||
{
|
||||
/* Reset hooks */
|
||||
cJSON_malloc = malloc;
|
||||
cJSON_free = free;
|
||||
return;
|
||||
}
|
||||
|
||||
cJSON_malloc = (hooks->malloc_fn)?hooks->malloc_fn:malloc;
|
||||
cJSON_free = (hooks->free_fn)?hooks->free_fn:free;
|
||||
cJSON_malloc = (hooks->malloc_fn) ? hooks->malloc_fn : malloc;
|
||||
cJSON_free = (hooks->free_fn) ? hooks->free_fn : free;
|
||||
}
|
||||
|
||||
/* Internal constructor. */
|
||||
|
||||
Reference in new issue
Block a user