(2006-08-06) rescue-bootcd
This commit is contained in:
23
extra/syslinux-3.09/com32/lib/memccpy.c
Normal file
23
extra/syslinux-3.09/com32/lib/memccpy.c
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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 */
|
||||
}
|
||||
Reference in New Issue
Block a user