| 2197 | } |
| 2198 | |
| 2199 | cJSON *cJSON_CreateStr(const char *string, size_t len) |
| 2200 | { |
| 2201 | cJSON *item = cJSON_New_Item(); |
| 2202 | if(item) |
| 2203 | { |
| 2204 | item->type = cJSON_String; |
| 2205 | item->valuestring = (char*)cJSON_strndup((const unsigned char*)string, len); |
| 2206 | if(!item->valuestring) |
| 2207 | { |
| 2208 | cJSON_Delete(item); |
| 2209 | return NULL; |
| 2210 | } |
| 2211 | } |
| 2212 | |
| 2213 | return item; |
| 2214 | } |
| 2215 | |
| 2216 | extern cJSON *cJSON_CreateRaw(const char *raw) |
| 2217 | { |
no test coverage detected