1 .\" Copyright 1995 James R. Van Zandt <jrv@vanzandt.mv.com>
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH STPCPY 3 2014-05-10 "GNU" "Linux Programmer's Manual"
27 stpcpy \- copy a string returning a pointer to its end
30 .B #include <string.h>
32 .BI "char *stpcpy(char *" dest ", const char *" src );
36 Feature Test Macro Requirements for glibc (see
37 .BR feature_test_macros (7)):
46 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
56 function copies the string pointed to by
58 (including the terminating null byte (\(aq\\0\(aq)) to the array pointed to by
60 The strings may not overlap, and the destination string
62 must be large enough to receive the copy.
65 returns a pointer to the
69 (that is, the address of the terminating null byte)
70 rather than the beginning.
72 .SS Multithreading (see pthreads(7))
75 function is thread-safe.
77 This function was added to POSIX.1-2008.
78 Before that, it was not part of
79 the C or POSIX.1 standards, nor customary on UNIX systems.
80 It first appeared at least as early as 1986,
81 in the Lattice C AmigaDOS compiler,
82 then in the GNU fileutils and GNU textutils in 1989,
83 and in the GNU C library by 1992.
84 It is also present on the BSDs.
86 This function may overrun the buffer
89 For example, this program uses
110 to = stpcpy(to, "foo");
111 to = stpcpy(to, "bar");
112 printf("%s\\n", buffer);