1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-10-30 12:03:52 -04:00
kernel/libk/strncpy.c

11 lines
204 B
C
Raw Normal View History

2017-11-08 03:33:24 -05:00
char *kstrncpy(char *const dest, const char *const src, const unsigned long slen)
2017-11-04 07:43:55 -04:00
{
2017-11-08 03:33:24 -05:00
for (unsigned long i = 0; i < slen; ++i) {
2017-11-04 07:43:55 -04:00
dest[i] = src[i];
}
2017-11-08 03:33:24 -05:00
dest[slen] = 0;
2017-11-04 07:43:55 -04:00
return dest;
}