mirror of
https://github.com/reactos/reactos.git
synced 2024-10-31 03:48:17 +00:00
1449523c6d
Addendum to aea4cfb
.
20 lines
361 B
C
20 lines
361 B
C
|
|
#include <string.h>
|
|
|
|
#if defined(_MSC_VER) && (_MSC_VER >= 1910 || !defined(_WIN64))
|
|
#pragma function(memchr)
|
|
#endif /* _MSC_VER */
|
|
|
|
void* __cdecl 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;
|
|
}
|