'\" t .\" Copyright, the authors of the Linux man-pages project .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .TH stpncpy 3 2026-08-10 "Linux man-pages 6.19" .SH NAME stpncpy \- nonstring return‐offset‐pointer copy .SH LIBRARY Standard C library .RI ( libc ,\~ \-lc ) .SH SYNOPSIS .nf .BR #include\~ " // see memory.h(3head)" .P .BR "char *stpncpy(" "size_t dsize;" .BI " char " dst "[restrict " dsize "], const char *restrict " src , .BI " size_t " dsize ); .fi .P .RS -4 Feature Test Macro Requirements for glibc (see .BR feature_test_macros (7)): .RE .P .BR stpncpy (): .nf Since glibc 2.10: _POSIX_C_SOURCE >= 200809L Before glibc 2.10: _GNU_SOURCE .fi .SH DESCRIPTION This function is equivalent to .BR strncpy (3), but it returns a pointer to one past the last nonnull written character. .P It is equivalent to .P .in +4n .EX memset(mempcpy(dst, src, strnlen(src, dsize)), \[aq]\[rs]0\[aq], dsize \- strnlen(src, dsize)) .EE .in .SH RETURN VALUE This function returns a pointer to one past the last non-null character written, that is, .IR dest\~+\~strnlen(src,\~n) . .SH ATTRIBUTES For an explanation of the terms used in this section, see .BR attributes (7). .TS allbox; lbx lb lb l l l. Interface Attribute Value T{ .na .nh .BR stpncpy () T} Thread safety MT-Safe .TE .SH STANDARDS POSIX.1-2008. .SH HISTORY glibc 1.07. POSIX.1-2008. .SH CAVEATS See .BR strncpy (3). .SH SEE ALSO .BR memory.h (3head), .BR string_copying (7)