| 10 | |
| 11 | |
| 12 | static inline char* allocateKey(const char* key, size_t length) { |
| 13 | char* result = (char*)malloc(length + 1); |
| 14 | memcpy(result, key, length); |
| 15 | result[length] = 0; |
| 16 | return result; |
| 17 | } |
| 18 | |
| 19 | static inline bool keyEquals(const char* candidate, const char* key, size_t length) { |
| 20 | return strncmp(candidate, key, length) == 0 && candidate[length] == 0; |