| 2328 | } |
| 2329 | |
| 2330 | CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) |
| 2331 | { |
| 2332 | cJSON *item = cJSON_New_Item(&global_hooks); |
| 2333 | if(item) |
| 2334 | { |
| 2335 | item->type = cJSON_String; |
| 2336 | item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); |
| 2337 | if(!item->valuestring) |
| 2338 | { |
| 2339 | cJSON_Delete(item); |
| 2340 | return NULL; |
| 2341 | } |
| 2342 | } |
| 2343 | |
| 2344 | return item; |
| 2345 | } |
| 2346 | |
| 2347 | CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) |
| 2348 | { |
no test coverage detected