MCPcopy Create free account
hub / github.com/SVF-tools/SVF / cJSON_CreateString

Function cJSON_CreateString

svf/lib/Util/cJSON.cpp:2462–2477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2460}
2461
2462CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string)
2463{
2464 cJSON *item = cJSON_New_Item(&global_hooks);
2465 if(item)
2466 {
2467 item->type = cJSON_String;
2468 item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks);
2469 if(!item->valuestring)
2470 {
2471 cJSON_Delete(item);
2472 return NULL;
2473 }
2474 }
2475
2476 return item;
2477}
2478
2479CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string)
2480{

Callers 4

cJSON_AddStringToObjectFunction · 0.85
cJSON_CreateStringArrayFunction · 0.85
getBugDescriptionMethod · 0.85
dumpToJsonFileMethod · 0.85

Calls 3

cJSON_New_ItemFunction · 0.85
cJSON_strdupFunction · 0.85
cJSON_DeleteFunction · 0.85

Tested by

no test coverage detected