strlcat

Appends a copy of one string to the end of a second string.

Library:LibC
Classification:Other
Service:Characters and Strings

Syntax

  #include <string.h> 
   
  size_t  strlcat (
     char         *dst,
     const char   *src,
     size_t        n);
  

Parameters

dst

(OUT) Points to the null-terminated string to which to append a copy of another string.

src

(IN) Points to the null-terminated string to be copied.

n

(IN) Specifies the number of bytes to copy.

Return Values

Returns the total length of the string, which is the initial length of dst plus the length of src.

Remarks

The strlcat function appends a copy of the string pointed to by src (including the null-terminating character) to the end of the string pointed to by dst. It appends at most n-1 bytes, and always null- terminates the string. The first character of src overwrites the NULL character at the end of dst.

See Also