| 2314 | } |
| 2315 | |
| 2316 | CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) |
| 2317 | { |
| 2318 | cJSON *item = cJSON_New_Item(&global_hooks); |
| 2319 | if(item) |
| 2320 | { |
| 2321 | item->type = cJSON_String; |
| 2322 | item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); |
| 2323 | if(!item->valuestring) |
| 2324 | { |
| 2325 | cJSON_Delete(item); |
| 2326 | return NULL; |
| 2327 | } |
| 2328 | } |
| 2329 | |
| 2330 | return item; |
| 2331 | } |
| 2332 | |
| 2333 | CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) |
| 2334 | { |
no test coverage detected