strlcpy3
String return-hypothetical-non-truncated-length copy/catenate (with truncation)
Usage
#include <string.h>
size_t strlcpy(size_t dsize; char dst[restrict dsize], const char *restrict src, size_t dsize); size_t strlcat(size_t dsize; char dst[restrict dsize], const char *restrict src, size_t dsize);
Library
Standard C library (libc, -lc)
Overview
strlcpy() copies the string pointed to by src, into a string at the buffer pointed to by dst.
strlcat() catenates the string pointed to by src, after the string pointed to by dst (overwriting its terminating null byte).
For both functions, if the string doesn't fit in the buffer, it is truncated.
Return value
These functions return the total length of the string they tried to create, as if truncation didn't happen.
Releases
6 releases since Debian 5.0 (Lenny); the text changed 3 times.