mirror of
https://github.com/reactos/reactos.git
synced 2024-09-23 02:56:00 +00:00
19 lines
215 B
C
19 lines
215 B
C
|
/*
|
||
|
* $Id$
|
||
|
*/
|
||
|
|
||
|
#include <string.h>
|
||
|
|
||
|
void* memchr(const void *s, int c, size_t n)
|
||
|
{
|
||
|
if (n)
|
||
|
{
|
||
|
const char *p = s;
|
||
|
do {
|
||
|
if (*p++ == c)
|
||
|
return (void *)(p-1);
|
||
|
} while (--n != 0);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|