| 2322 | } |
| 2323 | |
| 2324 | CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) |
| 2325 | { |
| 2326 | cJSON *item = cJSON_New_Item(&global_hooks); |
| 2327 | if(item) |
| 2328 | { |
| 2329 | item->type = cJSON_String; |
| 2330 | item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); |
| 2331 | if(!item->valuestring) |
| 2332 | { |
| 2333 | cJSON_Delete(item); |
| 2334 | return NULL; |
| 2335 | } |
| 2336 | } |
| 2337 | |
| 2338 | return item; |
| 2339 | } |
| 2340 | |
| 2341 | CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) |
| 2342 | { |
no test coverage detected