From af311d8149558dfd617dba62b96b76165ccc3855 Mon Sep 17 00:00:00 2001 From: imp Date: Sat, 7 Feb 2009 19:34:44 +0000 Subject: Make sure the comparison is done with an unsigned char. --- lib/libc/string/memchr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libc/string') diff --git a/lib/libc/string/memchr.c b/lib/libc/string/memchr.c index 6d7c2fd..d98d853 100644 --- a/lib/libc/string/memchr.c +++ b/lib/libc/string/memchr.c @@ -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); } -- cgit v1.1