MCPcopy Create free account
hub / github.com/Bwar/CJsonObject / cJSON_strdup

Function cJSON_strdup

cJSON.c:66–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64static void (*cJSON_free)(void *ptr) = free;
65
66static char* cJSON_strdup(const char* str)
67{
68 size_t len;
69 char* copy;
70
71 len = strlen(str) + 1;
72 if (!(copy = (char*) cJSON_malloc(len)))
73 return 0;
74 memcpy(copy, str, len);
75 return copy;
76}
77
78void cJSON_InitHooks(cJSON_Hooks* hooks)
79{

Callers 5

print_string_ptrFunction · 0.85
print_valueFunction · 0.85
cJSON_AddItemToObjectFunction · 0.85
cJSON_CreateStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected