| 2464 | } |
| 2465 | |
| 2466 | CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) |
| 2467 | { |
| 2468 | cJSON *item = cJSON_New_Item(&global_hooks); |
| 2469 | if(item) |
| 2470 | { |
| 2471 | item->type = cJSON_String; |
| 2472 | item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); |
| 2473 | if(!item->valuestring) |
| 2474 | { |
| 2475 | cJSON_Delete(item); |
| 2476 | return NULL; |
| 2477 | } |
| 2478 | } |
| 2479 | |
| 2480 | return item; |
| 2481 | } |
| 2482 | |
| 2483 | CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) |
| 2484 | { |
no test coverage detected
searching dependent graphs…