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