1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
10 .\" References consulted:
11 .\" GNU glibc-2 source code and manual
13 .\" Corrected, aeb, 990824
14 .TH STPNCPY 3 2021-03-22 "GNU" "Linux Programmer's Manual"
16 stpncpy \- copy a fixed-size string, returning a pointer to its end
19 .B #include <string.h>
21 .BI "char *stpncpy(char *restrict " dest ", const char *restrict " src \
26 Feature Test Macro Requirements for glibc (see
27 .BR feature_test_macros (7)):
33 _POSIX_C_SOURCE >= 200809L
40 function copies at most
42 characters from the string
45 including the terminating null byte (\(aq\e0\(aq),
46 to the array pointed to by
50 characters are written at
57 remaining characters in the array pointed to by
60 with null bytes (\(aq\e0\(aq),
63 is greater than or equal to
65 the string pointed to by
68 not be null-terminated.
70 The strings may not overlap.
72 The programmer must ensure that there is room for at least
79 returns a pointer to the terminating null byte
84 is not null-terminated,
87 For an explanation of the terms used in this section, see
95 Interface Attribute Value
98 T} Thread safety MT-Safe
104 This function was added to POSIX.1-2008.
105 Before that, it was a GNU extension.
106 It first appeared in version 1.07 of the GNU C library in 1993.