| 50 | static void (*cJSON_free)(void *ptr) = free; |
| 51 | |
| 52 | static char* cJSON_strdup(const char* str) |
| 53 | { |
| 54 | std::size_t len; |
| 55 | char* copy; |
| 56 | |
| 57 | len = strlen(str) + 1; |
| 58 | if (!(copy = static_cast<char*> ( cJSON_malloc(len)))) |
| 59 | { |
| 60 | return (nullptr); |
| 61 | } |
| 62 | |
| 63 | std::copy(str, str + len, copy); |
| 64 | return (copy); |
| 65 | } |
| 66 | |
| 67 | void cJSON_InitHooks(cJSON_Hooks* hooks) |
| 68 | { |
no outgoing calls
no test coverage detected