Uhm, you have two "e"s in there.
Or do it glibc-style
void *memchr(const void *s, unsigned char c, size_t n)
{
...
for (; p + 3 < e; p += 4) {
if (c == p[0])
return (void *)&p[0];
if (c == p[1])
return (void *)&p[1];
if (c == p[2])
return (void *)&p[2];
if (c == p[3])
return (void *)&p[3];
}
... /* check the rest */
}
Jan
--
-