source:
trunk/sys/dietlibc/memccpy.c
@
50
Last change on this file since 50 was 1, checked in by , 8 years ago | |
---|---|
File size: 308 bytes |
Rev | Line | |
---|---|---|
[1] | 1 | #define _POSIX_SOURCE |
2 | #define _XOPEN_SOURCE | |
3 | #include <sys/types.h> | |
4 | #include <string.h> | |
5 | ||
6 | void *memccpy(void *dst, const void *src, int c, size_t count) | |
7 | { | |
8 | char *a = dst; | |
9 | const char *b = src; | |
10 | while (count--) | |
11 | { | |
12 | *a++ = *b; | |
13 | if (*b==c) | |
14 | { | |
15 | return (void *)a; | |
16 | } | |
17 | b++; | |
18 | } | |
19 | return 0; | |
20 | } |
Note: See TracBrowser
for help on using the repository browser.