C2A_Core
memchr.c
[詳解]
1 
8 #include <string.h>
9 
10 void* memchr(const void* buf, int c, size_t n)
11 {
12  const unsigned char* s = (const unsigned char*) buf;
13 
14  while (n--)
15  {
16  if (*s == (unsigned char)c)
17  {
18  return (void*)s;
19  }
20  s++;
21  }
22 
23  return NULL;
24 }
void * memchr(const void *buf, int c, size_t n)
Definition: memchr.c:10