strl(3) - Linux man page

Name

strlcat(), strlcpy() - safer string manipulation functions

Synopsis

#include <sys/types.h> #include <strl.h>

size_t strlcat (register char *dst, register const char *src, ssize_t size);

size_t strlcpy (register char *dst, register const char *src, ssize_t size);

Description

These functions provide safer alternatives to strncat() and strncpy(), respectively. In each case, the size parameter indicates the total number of bytes available at dst and copies or appends only up to the point where dst is left as a NULL-terminated string. In both cases, the function returns the size of the resultant string had the operation succeded. Thus, if the return value exceeds size, then truncation occurred.

Notes

This is not required on systems that include strlcat() and strlcpy() in their C libraries.

History

These functions first appeared in OpenBSD 2.4, and then appeared in FreeBSD 3.3. This library's source code was originally written at Sendmail, Inc. sometime after that.

See Also

strncat(3), strncpy(3)

Copyright

Copyright © 1999-2002, Sendmail, Inc. All rights reserved.

Copyright © 2011, 2012, The Trusted Domain Project. All rights reserved.