From owner-svn-src-head@FreeBSD.ORG Sat Feb 7 19:34:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B66B1065672; Sat, 7 Feb 2009 19:34:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69B888FC17; Sat, 7 Feb 2009 19:34:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n17JYiqU001770; Sat, 7 Feb 2009 19:34:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n17JYiji001769; Sat, 7 Feb 2009 19:34:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902071934.n17JYiji001769@svn.freebsd.org> From: Warner Losh Date: Sat, 7 Feb 2009 19:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188295 - head/lib/libc/string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 19:34:45 -0000 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); }