(2006-08-06) rescue-bootcd
This commit is contained in:
22
extra/syslinux-3.09/com32/lib/strncpy.c
Normal file
22
extra/syslinux-3.09/com32/lib/strncpy.c
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* strncpy.c
|
||||
*
|
||||
* strncpy()
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
char *strncpy(char *dst, const char *src, size_t n)
|
||||
{
|
||||
char *q = dst;
|
||||
const char *p = src;
|
||||
char ch;
|
||||
|
||||
while ( n-- ) {
|
||||
*q++ = ch = *p++;
|
||||
if ( !ch )
|
||||
break;
|
||||
}
|
||||
|
||||
return dst;
|
||||
}
|
||||
Reference in New Issue
Block a user