| 2476 | } |
| 2477 | |
| 2478 | CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) |
| 2479 | { |
| 2480 | cJSON *item = cJSON_New_Item(&global_hooks); |
| 2481 | if(item) |
| 2482 | { |
| 2483 | item->type = cJSON_String; |
| 2484 | item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); |
| 2485 | if(!item->valuestring) |
| 2486 | { |
| 2487 | cJSON_Delete(item); |
| 2488 | return NULL; |
| 2489 | } |
| 2490 | } |
| 2491 | |
| 2492 | return item; |
| 2493 | } |
| 2494 | |
| 2495 | CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) |
| 2496 | { |
no test coverage detected