| 48 | static void (*cJSON_free)(void *ptr) = free; |
| 49 | |
| 50 | static char *cJSON_strdup(const char *str) { |
| 51 | size_t len; |
| 52 | char *copy; |
| 53 | |
| 54 | len = strlen(str) + 1; |
| 55 | if (!(copy = reinterpret_cast<char *>(cJSON_malloc(len)))) return 0; |
| 56 | memcpy(copy, str, len); |
| 57 | return copy; |
| 58 | } |
| 59 | |
| 60 | void cJSON_InitHooks(cJSON_Hooks *hooks) { |
| 61 | if (!hooks) { /* Reset hooks */ |
no outgoing calls
no test coverage detected