PatchworkOS
Loading...
Searching...
No Matches
memchr.c
Go to the documentation of this file.
1
#include <
string.h
>
2
3
void
*
memchr
(
const
void
* s,
int
c,
size_t
n)
4
{
5
const
unsigned
char
* p = (
const
unsigned
char
*)s;
6
7
while
(n--)
8
{
9
if
(*p == (
unsigned
char
)c)
10
{
11
return
(
void
*)p;
12
}
13
14
++p;
15
}
16
17
return
NULL
;
18
}
NULL
#define NULL
Pointer error value.
Definition
NULL.h:23
memchr
void * memchr(const void *s, int c, size_t n)
Definition
memchr.c:3
string.h
src
libstd
functions
string
memchr.c
Generated by
1.9.8