| 2451 | } |
| 2452 | |
| 2453 | CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) |
| 2454 | { |
| 2455 | cJSON *item = cJSON_New_Item(&global_hooks); |
| 2456 | if(item) |
| 2457 | { |
| 2458 | item->type = cJSON_String; |
| 2459 | item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); |
| 2460 | if(!item->valuestring) |
| 2461 | { |
| 2462 | cJSON_Delete(item); |
| 2463 | return NULL; |
| 2464 | } |
| 2465 | } |
| 2466 | |
| 2467 | return item; |
| 2468 | } |
| 2469 | |
| 2470 | CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) |
| 2471 | { |
no test coverage detected