In message: <20090207190418.ga...@nagual.pp.ru> Andrey Chernov <a...@nagual.pp.ru> 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 <string.h> : > : > 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 _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"