From owner-svn-src-all@FreeBSD.ORG Sat Feb 7 19:33:13 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E970106564A; Sat, 7 Feb 2009 19:33:13 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 499818FC21; Sat, 7 Feb 2009 19:33:13 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n17JWqs2083483; Sat, 7 Feb 2009 12:32:52 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 07 Feb 2009 12:32:53 -0700 (MST) Message-Id: <20090207.123253.-1775864766.imp@bsdimp.com> To: ache@nagual.pp.ru From: "M. Warner Losh" In-Reply-To: <20090207190418.GA336@nagual.pp.ru> References: <200902032025.n13KPaCV041012@svn.freebsd.org> <20090207190418.GA336@nagual.pp.ru> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188098 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2009 19:33:14 -0000 In message: <20090207190418.GA336@nagual.pp.ru> Andrey Chernov writes: : On Tue, Feb 03, 2009 at 08:25:36PM +0000, Warner Losh wrote: : > ============================================================================== : > --- head/lib/libc/string/memchr.c Tue Feb 3 20:01:51 2009 (r188097) : > +++ head/lib/libc/string/memchr.c Tue Feb 3 20:25:36 2009 (r188098) : > @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); : > #include : > : > void * : > -memchr(const void *s, unsigned char c, size_t n) : > +memchr(const void *s, int c, size_t n) : > { : > if (n != 0) { : > const unsigned char *p = s; : : You just broke comparison with negative chars, as memchr(3) says: : "The memchr() function locates the first occurrence of c (converted to an : unsigned char)" : : Please change : if (*p++ == c) : to : if (*p++ == (unsigned char)c) : (as in memrchr.c) Yes. Thanks. Warner