1 /* strl(cat|cpy) implementation for systems that do not have it in libc */
2 /* strl.c - strlcpy/strlcat implementation
3 * Time-stamp: <2004-03-14 njk>
4 * (C) 2003-2004 Nicholas J. Kain <njk@aerifal.cx>
10 unsigned int strlcpy (char *dest
, const char *src
, unsigned int size
)
12 register unsigned int i
= 0;
16 for (i
=0; size
> 0 && src
[i
] != '\0'; ++i
, size
--)
28 unsigned int strlcat (char *dest
, const char *src
, unsigned int size
)
30 register char *d
= dest
;
32 for (; size
> 0 && *d
!= '\0'; size
--, d
++);
33 return (d
- dest
) + strlcpy(d
, src
, size
);