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.320
1 files changed, 11 insertions, 9 deletions
diff --git a/src/lib/libc/string/strcpy.3 b/src/lib/libc/string/strcpy.3
index 36434ca04b..aab10f9ba8 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.8 1999/06/06 15:17:32 aaron Exp $ 36.\" $OpenBSD: strcpy.3,v 1.9 1999/06/29 18:01:33 aaron Exp $
37.\" 37.\"
38.Dd June 29, 1991 38.Dd June 29, 1991
39.Dt STRCPY 3 39.Dt STRCPY 3
@@ -92,20 +92,22 @@ return
92.Fa dst . 92.Fa dst .
93.Sh EXAMPLES 93.Sh EXAMPLES
94The following sets 94The following sets
95.Dq Li chararray 95.Va chararray
96to 96to
97.Dq Li abc\e0\e0\e0 : 97.Dq abc\e0\e0\e0 :
98.Bd -literal -offset indent 98.Bd -literal -offset indent
99(void)strncpy(chararray, "abc", 6); 99(void)strncpy(chararray, "abc", 6);
100.Ed 100.Ed
101.Pp 101.Pp
102The following sets 102The following sets
103.Dq Li chararray 103.Va chararray
104to 104to
105.Dq Li abcdef 105.Dq abcdef
106and does 106and does
107.Em not 107.Em not
108null terminate chararray because the source string is >= the length parameter. 108null terminate
109.Va chararray
110because the source string is >= the length parameter.
109.Fn strncpy 111.Fn strncpy
110.Em only 112.Em only
111null terminates the destination string when then length of the source 113null terminates the destination string when then length of the source
@@ -115,9 +117,9 @@ string is less than the length parameter.
115.Ed 117.Ed
116.Pp 118.Pp
117The following copies as many characters from 119The following copies as many characters from
118.Dq Li input 120.Va input
119to 121to
120.Dq Li buf 122.Va buf
121as will fit and null terminates the result. Because 123as will fit and null terminates the result. Because
122.Fn strncpy 124.Fn strncpy
123does 125does
@@ -143,7 +145,7 @@ is simply:
143.Xr memccpy 3 , 145.Xr memccpy 3 ,
144.Xr memcpy 3 , 146.Xr memcpy 3 ,
145.Xr memmove 3 , 147.Xr memmove 3 ,
146.Xr strlcpy 3 148.Xr strlcpy 3
147.Sh STANDARDS 149.Sh STANDARDS
148The 150The
149.Fn strcpy 151.Fn strcpy