__stpncpy_chk

Name

__stpncpy_chk -- copy a fixed-size string, returning a pointer to its end, with buffer overflow checking

Synopsis

#include <string.h>

char * __stpncpy_chk(char * dest, const char * src, size_t n, size_t destlen);

Description

The interface __stpncpy_chk() shall function in the same way as the interface stpncpy(), except that __stpncpy_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 destlen specifies the size of the object pointed to by dest. If n exceeds destlen, the function shall abort, and the program calling it shall exit.

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