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