SysTutorials

Linux Manual Pages › Section 3

stpncpy(3)

stpncpy – copy a fixed-size string, returning a pointer to its end

Synopsis

#include <string.h>
char *stpncpy(char *dest, const char *src, size_t n);

Feature Test Macro Requirements for glibc (see feature_test_macros(7)): stpncpy():

Since glibc 2.10:
_POSIX_C_SOURCE >= 200809L
Before glibc 2.10:
_GNU_SOURCE

Description

The stpncpy() function copies at most n characters from the string pointed to by src, including the terminating null byte (‘