home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
d
/
dec92.zip
/
1012014A
< prev
next >
Wrap
Text File
|
1992-10-06
|
317b
|
15 lines
/* memchr function */
#include <string.h>
void *(memchr)(const void *s, int c, size_t n)
{ /* find first occurrence of c in s[n] */
const unsigned char uc = c;
const unsigned char *su = (const unsigned char *)s;
for (; 0 n; ++su, --n)
if (*su == uc)
return ((void *)su);
return (NULL);
}