| 61 | } |
| 62 | |
| 63 | int strncasecmp(const char *str1, const char *str2, u32 len) |
| 64 | { |
| 65 | CE_ENSURE(NULL != str1); |
| 66 | CE_ENSURE(NULL != str2); |
| 67 | |
| 68 | for (u32 i = 0; i < len; ++i) { |
| 69 | const char c1 = str1[i]; |
| 70 | const char c2 = str2[i]; |
| 71 | const int d = tolower(c1) - tolower(c2); |
| 72 | if (d != 0 || c1 == '\0' || c2 == '\0') |
| 73 | return d; |
| 74 | } |
| 75 | |
| 76 | return 0; |
| 77 | } |
| 78 | |
| 79 | int from_hex(s64 &val, const char *hex) |
| 80 | { |
no outgoing calls
no test coverage detected