mirror of
https://github.com/UzixLS/KernelEx.git
synced 2025-07-19 07:21:20 +03:00
import KernelEx-4.0-RC1
This commit is contained in:
21
kexcrt/strncat.c
Normal file
21
kexcrt/strncat.c
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* strncat.c
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
char *strncat(char *dst, const char *src, size_t n)
|
||||
{
|
||||
char *q = strchr(dst, '\0');
|
||||
const char *p = src;
|
||||
char ch;
|
||||
|
||||
while (n--) {
|
||||
*q++ = ch = *p++;
|
||||
if (!ch)
|
||||
return dst;
|
||||
}
|
||||
*q = '\0';
|
||||
|
||||
return dst;
|
||||
}
|
Reference in New Issue
Block a user