safec
3.0
Safe C Library - ISO TR24731 Bounds Checking Interface
|
#include "safe_str_lib.h"
Functions | |
EXPORT errno_t | strncat_s (char *restrict dest, rsize_t dmax, const char *restrict src, rsize_t slen) |
The strncat_s function appends a copy of the string pointed to by src (including the terminating null character) to the end of the string pointed to by dest. More... | |
EXPORT errno_t strncat_s | ( | char *restrict | dest, |
rsize_t | dmax, | ||
const char *restrict | src, | ||
rsize_t | slen | ||
) |
The strncat_s function appends a copy of the string pointed to by src (including the terminating null character) to the end of the string pointed to by dest.
The initial character from src overwrites the null character at the end of dest.
All elements following the terminating null character (if any) written by strncat_s in the array of dmax characters pointed to by dest take unspeciļ¬ed values when strncat_s returns. With SAFECLIB_STR_NULL_SLACK defined the rest is cleared with NULL bytes.
[out] | dest | pointer to string that will be extended by src if dmax allows. The string is null terminated. If the resulting concatenated string is less than dmax, the remaining slack space is nulled. |
[in] | dmax | restricted maximum length of the resulting dest, including the null |
[in] | src | pointer to the string that will be concatenaed to string dest |
[in] | slen | maximum characters to append |
EOK | successful operation, all the characters from src null terminated. |
ESNULLP | when dest/src is NULL pointer |
ESZEROL | when dmax = 0 |
ESLEMAX | when dmax/slen > RSIZE_MAX_STR |
ESUNTERM | when dest not terminated |
ESOVRLP | when src overlaps with dest |