|
safec 3.15
Safe C Library - ISO TR24731 Bounds Checking Interface
|
#include "safe_str_lib.h"Functions | |
| EXPORT size_t | strlcat (char *restrict dest, const char *restrict src, size_t dsize) |
strlcat appends the NUL-terminated string src to the end of the NUL-terminated string dest, but never writes more than dsize bytes in total (including the terminating NUL) and always NUL-terminates the result (unless dsize is 0 or dest is not already NUL-terminated within the first dsize bytes). | |
| EXPORT size_t strlcat | ( | char *restrict | dest, |
| const char *restrict | src, | ||
| size_t | dsize ) |
strlcat appends the NUL-terminated string src to the end of the NUL-terminated string dest, but never writes more than dsize bytes in total (including the terminating NUL) and always NUL-terminates the result (unless dsize is 0 or dest is not already NUL-terminated within the first dsize bytes).
The caller must check whether truncation occurred by comparing the return value against dsize.
This is only compiled in when the platform libc does not already provide strlcat (see configure's HAVE_STRLCAT / cmake's HAVE_STRLCAT probe).
| [in,out] | dest | NUL-terminated buffer that src is appended to |
| [in] | src | pointer to the NUL-terminated string to append |
| [in] | dsize | total size of the dest buffer, in bytes |