Make sure the comparison is done with an unsigned char.
This commit is contained in:
parent
37ce2656ec
commit
0ff7d9b4e9
@ -45,7 +45,7 @@ memchr(const void *s, int c, size_t n)
|
||||
const unsigned char *p = s;
|
||||
|
||||
do {
|
||||
if (*p++ == c)
|
||||
if (*p++ == (unsigned char)c)
|
||||
return ((void *)(p - 1));
|
||||
} while (--n != 0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user