STRNCPY(3)

NAME
strncpy - counted copy string

SYNOPSIS

#include <string.h>

char *strncpy(char *restrict dst, const char *restrict src, size_t length);

DESCRIPTION

strncpy copies not more than length characters from the the string pointed to by src (including the terminating null character) to the array pointed to by dst. If the string pointed to by src is shorter than length characters, null characters are appended to the destination array until a total of length characters have been written.

RETURNS

This function returns the initial value of dst.

PORTABILITY

strncpy is ANSI C.

strncpy requires no supporting OS subroutines.