Systemd/klibc/klibc/memchr.c
greg@kroah.com a41a0e28c2 [PATCH] added klibc version 0.82 (cvs tree) to the udev tree.
Not hooked up to the build yet.
2005-04-26 21:05:23 -07:00

19 lines
240 B
C

/*
* memchr.c
*/
#include <stddef.h>
#include <string.h>
void *memchr(const void *s, int c, size_t n)
{
const unsigned char *sp = s;
while ( n-- ) {
if ( *sp == (unsigned char)c )
return (void *)sp;
}
return NULL;
}