libite
Functions
strlcat.c File Reference
#include <sys/types.h>
#include <string.h>
Include dependency graph for strlcat.c:

Functions

size_t strlcat (char *dst, const char *src, size_t dsize)
 Safe version of strncat() from OpenBSD. More...
 

Detailed Description

Author
Todd C. Miller
Date
1998, 2015

Function Documentation

◆ strlcat()

size_t strlcat ( char *  dst,
const char *  src,
size_t  dsize 
)

Safe version of strncat() from OpenBSD.

Parameters
dstDestination string
srcSource string
dsizeTotal maximum size of dst

Appends src to string dst of size dsize (unlike strncat(), dsize is the full size of dst, not space left). At most dsize-1 characters will be copied. Always NUL terminates (unless dsize <= strlen(dst)).

Returns
strlen(src) + MIN(dsize, strlen(initial dst)). If retval >= dsize, truncation occurred.