This repository has been archived on 2023-08-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
RescueBootCD/extra/syslinux-3.09/com32/lib/memccpy.c

24 lines
327 B
C

/*
* 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 */
}