home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
diffutils-2.7-src.tgz
/
tar.out
/
fsf
/
diffutils
/
memchr.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-09-28
|
313b
|
20 lines
/* Support memchr on systems where it doesn't work. */
#include <config.h>
#include <sys/types.h>
void *
memchr (s, c, n)
void const *s;
int c;
size_t n;
{
unsigned char const *p = s;
unsigned char const *lim = p + n;
for (; p < lim; p++)
if (*p == c)
return p;
return 0;
}