Deleted Added
full compact
strcpy.3 (190798) strcpy.3 (208027)
1.\" Copyright (c) 1990, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without

--- 16 unchanged lines hidden (view full) ---

25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)strcpy.3 8.1 (Berkeley) 6/4/93
1.\" Copyright (c) 1990, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" Redistribution and use in source and binary forms, with or without

--- 16 unchanged lines hidden (view full) ---

25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)strcpy.3 8.1 (Berkeley) 6/4/93
33.\" $FreeBSD: head/lib/libc/string/strcpy.3 190798 2009-04-07 13:42:53Z trasz $
33.\" $FreeBSD: head/lib/libc/string/strcpy.3 208027 2010-05-13 12:07:55Z uqs $
34.\"
35.Dd February 28, 2009
36.Dt STRCPY 3
37.Os
38.Sh NAME
39.Nm stpcpy, stpncpy, strcpy , strncpy
40.Nd copy strings
41.Sh LIBRARY

--- 127 unchanged lines hidden (view full) ---

169as shown in the following example:
170.Pp
171.Dl "(void)strlcpy(buf, input, sizeof(buf));"
172.Pp
173Note that because
174.Xr strlcpy 3
175is not defined in any standards, it should
176only be used when portability is not a concern.
34.\"
35.Dd February 28, 2009
36.Dt STRCPY 3
37.Os
38.Sh NAME
39.Nm stpcpy, stpncpy, strcpy , strncpy
40.Nd copy strings
41.Sh LIBRARY

--- 127 unchanged lines hidden (view full) ---

169as shown in the following example:
170.Pp
171.Dl "(void)strlcpy(buf, input, sizeof(buf));"
172.Pp
173Note that because
174.Xr strlcpy 3
175is not defined in any standards, it should
176only be used when portability is not a concern.
177.Sh SECURITY CONSIDERATIONS
178The
179.Fn strcpy
180function is easily misused in a manner which enables malicious users
181to arbitrarily change a running program's functionality through a
182buffer overflow attack.
183(See
184the FSA
185and
186.Sx EXAMPLES . )
187.Sh SEE ALSO
188.Xr bcopy 3 ,
189.Xr memccpy 3 ,
190.Xr memcpy 3 ,
191.Xr memmove 3 ,
192.Xr strlcpy 3 ,
193.Xr wcscpy 3
194.Sh STANDARDS

--- 14 unchanged lines hidden (view full) ---

209The
210.Fn stpcpy
211function first appeared in
212.Fx 4.4 ,
213and
214.Fn stpncpy
215was added in
216.Fx 8.0 .
177.Sh SEE ALSO
178.Xr bcopy 3 ,
179.Xr memccpy 3 ,
180.Xr memcpy 3 ,
181.Xr memmove 3 ,
182.Xr strlcpy 3 ,
183.Xr wcscpy 3
184.Sh STANDARDS

--- 14 unchanged lines hidden (view full) ---

199The
200.Fn stpcpy
201function first appeared in
202.Fx 4.4 ,
203and
204.Fn stpncpy
205was added in
206.Fx 8.0 .
207.Sh SECURITY CONSIDERATIONS
208The
209.Fn strcpy
210function is easily misused in a manner which enables malicious users
211to arbitrarily change a running program's functionality through a
212buffer overflow attack.
213(See
214the FSA
215and
216.Sx EXAMPLES . )