MCPcopy Index your code
hub / github.com/antirez/botlib / cJSON_AddStringToObject

Function cJSON_AddStringToObject

cJSON.c:2135–2145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2133}
2134
2135CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string)
2136{
2137 cJSON *string_item = cJSON_CreateString(string);
2138 if (add_item_to_object(object, name, string_item, &global_hooks, false))
2139 {
2140 return string_item;
2141 }
2142
2143 cJSON_Delete(string_item);
2144 return NULL;
2145}
2146
2147CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw)
2148{

Callers

nothing calls this directly

Calls 3

cJSON_CreateStringFunction · 0.85
add_item_to_objectFunction · 0.85
cJSON_DeleteFunction · 0.85

Tested by

no test coverage detected