summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strcpy.3
diff options
context:
space:
mode:
authoraaron <>1999-06-04 19:14:56 +0000
committeraaron <>1999-06-04 19:14:56 +0000
commit569578dc356ba2402bc9d1b54016c009127366cb (patch)
treea66749999785172106ab5135b5e7840c8e7b9541 /src/lib/libc/string/strcpy.3
parentb54ee9c910d2afd114c02825c362ba253d8bf917 (diff)
downloadopenbsd-569578dc356ba2402bc9d1b54016c009127366cb.tar.gz
openbsd-569578dc356ba2402bc9d1b54016c009127366cb.tar.bz2
openbsd-569578dc356ba2402bc9d1b54016c009127366cb.zip
some repairs, add example to strdup(3) page
Diffstat (limited to 'src/lib/libc/string/strcpy.3')
-rw-r--r--src/lib/libc/string/strcpy.314
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libc/string/strcpy.3 b/src/lib/libc/string/strcpy.3
index 80d528caef..75727223ff 100644
--- a/src/lib/libc/string/strcpy.3
+++ b/src/lib/libc/string/strcpy.3
@@ -33,13 +33,14 @@
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.6 1999/05/23 14:11:03 aaron Exp $ 36.\" $OpenBSD: strcpy.3,v 1.7 1999/06/04 19:14:56 aaron Exp $
37.\" 37.\"
38.Dd June 29, 1991 38.Dd June 29, 1991
39.Dt STRCPY 3 39.Dt STRCPY 3
40.Os 40.Os
41.Sh NAME 41.Sh NAME
42.Nm strcpy 42.Nm strcpy,
43.Nm strncpy
43.Nd copy strings 44.Nd copy strings
44.Sh SYNOPSIS 45.Sh SYNOPSIS
45.Fd #include <string.h> 46.Fd #include <string.h>
@@ -61,7 +62,6 @@ to
61.Ql \e0 62.Ql \e0
62character). 63character).
63.Pp 64.Pp
64The
65.Fn strncpy 65.Fn strncpy
66copies not more than 66copies not more than
67.Fa len 67.Fa len
@@ -105,10 +105,10 @@ to
105.Dq Li abcdef 105.Dq Li abcdef
106and does 106and does
107.Em not 107.Em not
108NUL-terminate chararray because the source string is >= the length parameter. 108null terminate chararray because the source string is >= the length parameter.
109.Fn strncpy 109.Fn strncpy
110.Em only 110.Em only
111NUL-terminates the destination string when then length of the source 111null terminates the destination string when then length of the source
112string is less than the length parameter. 112string is less than the length parameter.
113.Bd -literal -offset indent 113.Bd -literal -offset indent
114(void)strncpy(chararray, "abcdefgh", 6); 114(void)strncpy(chararray, "abcdefgh", 6);
@@ -118,11 +118,11 @@ The following copies as many characters from
118.Dq Li input 118.Dq Li input
119to 119to
120.Dq Li buf 120.Dq Li buf
121as will fit and NUL-terminates the result. Because 121as will fit and null terminates the result. Because
122.Fn strncpy 122.Fn strncpy
123does 123does
124.Em not 124.Em not
125guarantee to NUL-terminate the string itself, we must do this by hand. 125guarantee to null terminate the string itself, we must do this by hand.
126.Bd -literal -offset indent 126.Bd -literal -offset indent
127char buf[BUFSIZ]; 127char buf[BUFSIZ];
128 128