strlcpy

Copies a string.

Library:LibC
Classification:Other
Service:Characters and Strings

Syntax

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

Parameters

dst

(OUT) Points to the array into which to copy the string.

src

(IN) Points to the string to be copied.

n

(IN) Specifies the number of bytes to copy.

Return Values

Returns the total length of the copied string, which is the length of src.

Remarks

The strlcpy function copies up to n-1 bytes from src to dst and null-terminates the string.

See Also