libite
Functions
strlcpy.c File Reference
#include <sys/types.h>
#include <string.h>
Include dependency graph for strlcpy.c:

Functions

size_t strlcpy (char *dst, const char *src, size_t dsize)
 Safe version of strncpy() from OpenBSD. More...
 

Detailed Description

Author
Todd C. Miller
Date
1998, 2015

Function Documentation

◆ strlcpy()

size_t strlcpy ( char *  dst,
const char *  src,
size_t  dsize 
)

Safe version of strncpy() from OpenBSD.

Parameters
dstDestination string
srcSource string
dsizeTotal maximum size of dst

This function copies string src to buffer dst of size dsize bytes. At most dsize-1 chars will be copied. Always NUL terminates (unless dsize==0).

Returns
strlen(src); if retval >= dsize, truncation occurred.