| 2365 | } |
| 2366 | |
| 2367 | CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) |
| 2368 | { |
| 2369 | cJSON *item = cJSON_New_Item(&global_hooks); |
| 2370 | if(item) |
| 2371 | { |
| 2372 | item->type = cJSON_String; |
| 2373 | item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); |
| 2374 | if(!item->valuestring) |
| 2375 | { |
| 2376 | cJSON_Delete(item); |
| 2377 | return NULL; |
| 2378 | } |
| 2379 | } |
| 2380 | |
| 2381 | return item; |
| 2382 | } |
| 2383 | |
| 2384 | CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) |
| 2385 | { |
no test coverage detected