libite 2.6.1
strlcpy.c File Reference
#include <sys/types.h>
#include <string.h>

Go to the source code of this file.

Functions

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

Detailed Description

Author
Todd C. Miller
Date
1998, 2015

Definition in file strlcpy.c.

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.

Definition at line 44 of file strlcpy.c.