__strncpy_chk

Name

__strncpy_chk -- copy a string, with buffer overflow checking

Synopsis

#include <string.h>

char * __strncpy_chk(char * s1, const char * s2, size_t n, size_t s1len);

Description

The interface __strncpy_chk() shall function in the same way as the interface strncpy(), except that __strncpy_chk() shall check for buffer overflow before computing a result. If an overflow is anticipated, the function shall abort and the program calling it shall exit.

The parameter s1len specifies the size of the object pointed to by s1.

The __strncpy_chk() function is not in the source standard; it is only in the binary standard.