reactos/lib/sdk/crt/mem/memccpy.c
Amine Khaldi c424146e2c Create a branch for cmake bringup.
svn path=/branches/cmake-bringup/; revision=48236
2010-07-24 18:52:44 +00:00

26 lines
365 B
C

/*
* $Id$
*/
#include <string.h>
void *
_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 */
}