Message-Id: <199611281906.OAA13959@delorie.com> From: Oberhumer Markus Subject: Bug: memchr() is not 8-bit clean To: dj AT delorie DOT com Date: Thu, 28 Nov 1996 20:06:05 +0100 (MET) Cc: djgpp-workers AT delorie DOT com (djgpp-workers) Return-Read-To: markus DOT oberhumer AT jk DOT uni-linz DOT ac DOT at Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 756 =============================================================================== Markus F.X.J. Oberhumer Subject: Bug: memchr() is not 8-bit clean To: DJ, djgpp-workers AT delorie DOT com =============================================================================== This is the correct version of src/libc/ansi/string/memchr.c: /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ #include #include void * memchr(const void *s, int c, size_t n) { if (n) { const char *p = s; char cc = c; do { if (*p == cc) return unconst(p, void *); p++; } while (--n != 0); } return 0; }