Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
xt_strlcpy(3)		    Library Functions Manual		   xt_strlcpy(3)

NAME
     xt_strcpy() - Copy a string without risk of buffer overflow

LIBRARY
     #include <xtend/string.h>
     -lxtend

SYNOPSIS
     size_t  xt_strlcpy(char * restrict dest, const char * restrict src,
     size_t dstsize)

ARGUMENTS
     dest:   Pointer to a character array of at least len dstsize, where
     the possibly modified string is stored.
     src:    Point to a character array containing the string to compact
     dstsize: Length of the dest array

DESCRIPTION
     Copy  string src to dest, truncating to a maximum length of dstsize if nec-
     essary.

RETURN VALUES
     The length of the source string.  If the return value is  larger  than  the
     dstsize, then truncation has occurred.

EXAMPLES
     #define MAXLEN  127
     char    limited_str[MAXLEN + 1],
	     original_str[SOME_OTHER_LEN + 1];

     xt_strcpy(limited_str, original_str, MAXLEN + 1);

SEE ALSO
     xt_strlsqueeze(3), xt_strlcat(3)

								   xt_strlcpy(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=xt_strlcpy&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help