mirror of
https://github.com/reactos/reactos.git
synced 2024-08-19 18:02:55 +00:00
24 lines
398 B
C
24 lines
398 B
C
|
|
#include <string.h>
|
|
|
|
|
|
void *
|
|
__cdecl
|
|
_memccpy (void *to, const void *from,int c,size_t count)
|
|
{
|
|
char t;
|
|
size_t i;
|
|
char *dst=(char*)to;
|
|
const char *src=(const char*)from;
|
|
|
|
for ( i = 0; i < count; i++ )
|
|
{
|
|
dst[i] = t = src[i];
|
|
if ( t == '\0' )
|
|
break;
|
|
if ( t == c )
|
|
return &dst[i+1];
|
|
}
|
|
return NULL; /* didn't copy c */
|
|
}
|