mirror of
https://github.com/UzixLS/KernelEx.git
synced 2025-07-18 23:11:19 +03:00
22 lines
251 B
C
Executable File
22 lines
251 B
C
Executable File
/*
|
|
* 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;
|
|
}
|