MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / cJSON_CreateString

Function cJSON_CreateString

lib/cJSON.c:2182–2197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2180}
2181
2182cJSON *cJSON_CreateString(const char *string)
2183{
2184 cJSON *item = cJSON_New_Item();
2185 if(item)
2186 {
2187 item->type = cJSON_String;
2188 item->valuestring = (char*)cJSON_strdup((const unsigned char*)string);
2189 if(!item->valuestring)
2190 {
2191 cJSON_Delete(item);
2192 return NULL;
2193 }
2194 }
2195
2196 return item;
2197}
2198
2199cJSON *cJSON_CreateStr(const char *string, size_t len)
2200{

Callers 2

cJSON_CreateStringArrayFunction · 0.70
evi_build_payloadFunction · 0.50

Calls 3

cJSON_New_ItemFunction · 0.70
cJSON_strdupFunction · 0.70
cJSON_DeleteFunction · 0.70

Tested by

no test coverage detected