mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-27 23:41:18 +01:00
sys/posix: fix strncasecmp
This should be a OR or when comparing only parts os strings would return a wrong value. const char *first = "testA"; const char *second = "test"; uint8_t contains = strncasecmp(first, second, strlen(second));
This commit is contained in:
parent
258083323a
commit
237e3f4dcb
@ -18,7 +18,7 @@
|
||||
int strncasecmp(const char *s1, const char *s2, size_t n)
|
||||
{
|
||||
while (n-- && tolower((unsigned char) *s1) == tolower((unsigned char) *s2)) {
|
||||
if (!n && !*s1) {
|
||||
if (!n || !*s1) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user