summaryrefslogtreecommitdiffstats
path: root/lib/libc/string
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2009-02-07 19:34:44 +0000
committerimp <imp@FreeBSD.org>2009-02-07 19:34:44 +0000
commitaf311d8149558dfd617dba62b96b76165ccc3855 (patch)
tree831751b6950db504c57c1c124e866a601f346453 /lib/libc/string
parentd34fad29235ccc0edbe6d08993a47cfe168f59d9 (diff)
downloadFreeBSD-src-af311d8149558dfd617dba62b96b76165ccc3855.zip
FreeBSD-src-af311d8149558dfd617dba62b96b76165ccc3855.tar.gz
Make sure the comparison is done with an unsigned char.
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/memchr.c2
1 files changed, 1 insertions, 1 deletions
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);
}
OpenPOWER on IntegriCloud