Case-insensitive, size-constrained, lexical comparison. * * Compares a specified maximum number of characters of two strings for * lexical equivalence in a case-insensitive manner. * * @param[in] s1 - The first string to be compared. * @param[in] s2 - The second string to be compared. * @param[in] len - The maximum number of characters to compare. * * @return Zero if at least @p len chara
| 140 | * @internal |
| 141 | */ |
| 142 | int strncasecmp(const char * s1, const char * s2, size_t len) |
| 143 | { |
| 144 | while (*s1 && (*s1 == *s2 || tolower(*s1) == tolower(*s2))) |
| 145 | { |
| 146 | len--; |
| 147 | if (len == 0) |
| 148 | return 0; |
| 149 | s1++; |
| 150 | s2++; |
| 151 | } |
| 152 | return (int)*(const unsigned char *)s1 - (int)*(const unsigned char *)s2; |
| 153 | } |
| 154 | #endif |
| 155 | |
| 156 | #ifndef HAVE_STRCASESTR |
no outgoing calls
no test coverage detected