msvcrt: Copy memchr implementation from ntdll.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2020-07-22 11:10:19 +02:00 committed by Alexandre Julliard
parent 75cdc3b605
commit 9d4eeaeb77
1 changed files with 4 additions and 1 deletions

View File

@ -2267,7 +2267,10 @@ char* __cdecl MSVCRT_strrchr(const char *str, int c)
*/
void* __cdecl MSVCRT_memchr(const void *ptr, int c, MSVCRT_size_t n)
{
return memchr(ptr, c, n);
const unsigned char *p = ptr;
for (p = ptr; n; n--, p++) if (*p == c) return (void *)(ULONG_PTR)p;
return NULL;
}
/*********************************************************************