| 2529 | } |
| 2530 | |
| 2531 | CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) |
| 2532 | { |
| 2533 | cJSON *item = cJSON_New_Item(&global_hooks); |
| 2534 | if(item) |
| 2535 | { |
| 2536 | item->type = cJSON_String; |
| 2537 | item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); |
| 2538 | if(!item->valuestring) |
| 2539 | { |
| 2540 | cJSON_Delete(item); |
| 2541 | return NULL; |
| 2542 | } |
| 2543 | } |
| 2544 | |
| 2545 | return item; |
| 2546 | } |
| 2547 | |
| 2548 | CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) |
| 2549 | { |
no test coverage detected