MCPcopy Create free account
hub / github.com/OpenDriveLab/OpenLane / cJSON_strdup

Function cJSON_strdup

eval/LANE_evaluation/lane2d/src/cJSON.c:64–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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