Adding upstream version 3.50~pre5.
[syslinux-debian/hramrach.git] / com32 / lib / strlcat.c
blobf9db71561d2459fff6f60ae97a4add440dd4176c
1 /*
2 * strlcat.c
3 */
5 #include <string.h>
6 #include <klibc/compiler.h>
8 size_t strlcat(char *dst, const char *src, size_t size)
10 size_t bytes = 0;
11 char *q = dst;
12 const char *p = src;
13 char ch;
15 while ( bytes < size && *q ) {
16 q++;
17 bytes++;
20 while ( (ch = *p++) ) {
21 if ( bytes < size )
22 *q++ = ch;
24 bytes++;
27 *q = '\0';
28 return bytes;