1
0
mirror of https://github.com/UzixLS/KernelEx.git synced 2025-07-18 23:11:19 +03:00
Files
KernelEx/kexcrt/memccpy.c
2018-11-03 16:21:13 +03:00

24 lines
309 B
C
Executable File

/*
* memccpy.c
*
* memccpy()
*/
#include <stddef.h>
#include <string.h>
void *memccpy(void *dst, const void *src, int c, size_t n)
{
char *q = dst;
const char *p = src;
char ch;
while (n--) {
*q++ = ch = *p++;
if (ch == (char)c)
return q;
}
return NULL; /* No instance of "c" found */
}