1 --- strcpy.3.orig 2010-04-28 23:38:50.000000000 -0700
2 +++ strcpy.3 2010-04-29 09:37:17.000000000 -0700
7 -.Fn stpcpy "char * restrict dst" "const char * restrict src"
13 -.Fn stpncpy "char * restrict dst" "const char * restrict src" "size_t len"
15 +.Fa "char *restrict s1"
16 +.Fa "const char *restrict s2"
20 -.Fn strcpy "char * restrict dst" "const char * restrict src"
22 +.Fa "char *restrict s1"
23 +.Fa "const char *restrict s2"
26 -.Fn strncpy "char * restrict dst" "const char * restrict src" "size_t len"
28 +.Fa "char *restrict s1"
29 +.Fa "const char *restrict s2"
35 @@ -57,38 +71,41 @@ and
44 (including the terminating
53 functions copy at most
82 +The source and destination strings should not overlap, as the
83 +behavior is undefined.
87 @@ -96,7 +113,7 @@ and
96 @@ -104,15 +121,15 @@ and
97 functions return a pointer to the terminating
109 character, it instead returns a pointer to
112 (which does not necessarily refer to a valid memory location.)
115 @@ -139,7 +156,7 @@ Note that it does
121 because the length of the source string is greater than or equal
122 to the length argument.
124 @@ -169,21 +186,26 @@ This could be better achieved using
125 as shown in the following example:
127 .Dl "(void)strlcpy(buf, input, sizeof(buf));"
131 -is not defined in any standards, it should
132 -only be used when portability is not a concern.
133 .Sh SECURITY CONSIDERATIONS
136 -function is easily misused in a manner which enables malicious users
142 +functions are easily misused in a manner which enables malicious users
143 to arbitrarily change a running program's functionality through a
144 buffer overflow attack.
150 +It is recommended that
152 +be used instead as a way to avoid such problems.
154 +is not defined in any standards, but it has been adopted by most major libc implementations.