summaryrefslogtreecommitdiffstats
path: root/osdep/strlcat.c
blob: 1facc3333d97669fc6b997143c70f7a47f414050 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* strlcat implementation for systems that do not have it in libc
 * Time-stamp: <2004-03-14 njk>
 * (C) 2003-2004 Nicholas J. Kain <njk@aerifal.cx>
 */

#include "config.h"

unsigned int strlcat (char *dest, const char *src, unsigned int size)
{
	register char *d = dest;

	for (; size > 0 && *d != '\0'; size--, d++);
	return (d - dest) + strlcpy(d, src, size);
}