Date: Sat, 7 Feb 2009 19:34:44 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r188295 - head/lib/libc/string Message-ID: <200902071934.n17JYiji001769@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Sat Feb 7 19:34:44 2009 New Revision: 188295 URL: http://svn.freebsd.org/changeset/base/188295 Log: Make sure the comparison is done with an unsigned char. Modified: head/lib/libc/string/memchr.c Modified: head/lib/libc/string/memchr.c ============================================================================== --- head/lib/libc/string/memchr.c Sat Feb 7 18:49:42 2009 (r188294) +++ head/lib/libc/string/memchr.c Sat Feb 7 19:34:44 2009 (r188295) @@ -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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902071934.n17JYiji001769>