chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
78223152c4f98d53445f28633f431026e4726dfb
[elogind.git]
/
klibc
/
klibc
/
strncat.c
1
/*
2
* strncat.c
3
*/
4
5
#include <string.h>
6
#include <klibc/compiler.h>
7
8
char *strncat(char *dst, const char *src, size_t n)
9
{
10
char *q = strchr(dst, '\0');
11
const char *p = src;
12
char ch;
13
14
while (n--) {
15
*q++ = ch = *p++;
16
if ( !ch )
17
return dst;
18
}
19
*q = '\0';
20
21
return dst;
22
}