blob: fb4b1d148a0f6fd3104fac9b4111a6da0ee73e09 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include <u.h>
#include <libc.h>
void*
memchr(void *ap, int c, ulong n)
{
uchar *sp;
sp = ap;
c &= 0xFF;
while(n > 0) {
if(*sp++ == c)
return sp-1;
n--;
}
return 0;
}
|