Make sure the comparison is done with an unsigned char.

This commit is contained in:
Warner Losh 2009-02-07 19:34:44 +00:00
parent 37ce2656ec
commit 0ff7d9b4e9

View File

@ -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);
}