Sign in
googlers
/
maze
/
klibc
/
d9d829b93d359a98e27fd610da9a244c892e33a6
/
.
/
klibc
/
memchr.c
blob: 2e5e4cc7f20b977642af202c3b398042f0778e76 [
file
] [
log
] [
blame
]
/*
* 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
;
sp
++;
}
return
NULL
;
}