summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strcpy.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/string/strcpy.3')
-rw-r--r--src/lib/libc/string/strcpy.317
1 files changed, 8 insertions, 9 deletions
diff --git a/src/lib/libc/string/strcpy.3 b/src/lib/libc/string/strcpy.3
index aab10f9ba8..1dbeafa6e8 100644
--- a/src/lib/libc/string/strcpy.3
+++ b/src/lib/libc/string/strcpy.3
@@ -33,7 +33,7 @@
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 34.\" SUCH DAMAGE.
35.\" 35.\"
36.\" $OpenBSD: strcpy.3,v 1.9 1999/06/29 18:01:33 aaron Exp $ 36.\" $OpenBSD: strcpy.3,v 1.10 2000/04/21 15:24:20 aaron Exp $
37.\" 37.\"
38.Dd June 29, 1991 38.Dd June 29, 1991
39.Dt STRCPY 3 39.Dt STRCPY 3
@@ -53,8 +53,7 @@ The
53.Fn strcpy 53.Fn strcpy
54and 54and
55.Fn strncpy 55.Fn strncpy
56functions 56functions copy the string
57copy the string
58.Fa src 57.Fa src
59to 58to
60.Fa dst 59.Fa dst
@@ -87,8 +86,7 @@ The
87.Fn strcpy 86.Fn strcpy
88and 87and
89.Fn strncpy 88.Fn strncpy
90functions 89functions return
91return
92.Fa dst . 90.Fa dst .
93.Sh EXAMPLES 91.Sh EXAMPLES
94The following sets 92The following sets
@@ -120,7 +118,8 @@ The following copies as many characters from
120.Va input 118.Va input
121to 119to
122.Va buf 120.Va buf
123as will fit and null terminates the result. Because 121as will fit and null terminates the result.
122Because
124.Fn strncpy 123.Fn strncpy
125does 124does
126.Em not 125.Em not
@@ -134,7 +133,8 @@ buf[sizeof(buf) - 1] = '\e0';
134.Pp 133.Pp
135Note that 134Note that
136.Xr strlcpy 3 135.Xr strlcpy 3
137is a better choice for this kind of operation. The equivalent using 136is a better choice for this kind of operation.
137The equivalent using
138.Xr strlcpy 3 138.Xr strlcpy 3
139is simply: 139is simply:
140.Bd -literal -offset indent 140.Bd -literal -offset indent
@@ -151,6 +151,5 @@ The
151.Fn strcpy 151.Fn strcpy
152and 152and
153.Fn strncpy 153.Fn strncpy
154functions 154functions conform to
155conform to
156.St -ansiC . 155.St -ansiC .