| 63 | #define false ((cJSON_bool)0) |
| 64 | |
| 65 | static unsigned char *cJSONUtils_strdup(const unsigned char *const string) |
| 66 | { |
| 67 | size_t length = 0; |
| 68 | unsigned char *copy = NULL; |
| 69 | |
| 70 | length = strlen((const char *)string) + sizeof(""); |
| 71 | copy = (unsigned char *)cJSON_malloc(length); |
| 72 | if (copy == NULL) |
| 73 | { |
| 74 | return NULL; |
| 75 | } |
| 76 | memcpy(copy, string, length); |
| 77 | |
| 78 | return copy; |
| 79 | } |
| 80 | |
| 81 | /* string comparison which doesn't consider NULL pointers equal */ |
| 82 | static int compare_strings(const unsigned char *string1, const unsigned char *string2, const cJSON_bool case_sensitive) |
no test coverage detected