git://git.jankratochvil.net
/
reactos.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
update for HEAD-2003021201
[reactos.git]
/
lib
/
msvcrt
/
string
/
memccpy.c
1
#include <msvcrt/string.h>
2
3
4
void *
5
_memccpy (void *to, const void *from,int c,size_t count)
6
{
7
char t;
8
size_t i;
9
char *dst=(char*)to;
10
const char *src=(const char*)from;
11
12
for ( i = 0; i < count; i++ )
13
{
14
dst[i] = t = src[i];
15
if ( t == '\0' )
16
break;
17
if ( t == c )
18
return &dst[i+1];
19
}
20
return NULL; /* didn't copy c */
21
}