MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / cJSON_strdup

Function cJSON_strdup

outofcore/src/cJSON.cpp:52–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50static void (*cJSON_free)(void *ptr) = free;
51
52static 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
67void cJSON_InitHooks(cJSON_Hooks* hooks)
68{

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