]> git.saurik.com Git - apple/libc.git/blob - string/FreeBSD/strcpy.3.patch
Libc-498.tar.gz
[apple/libc.git] / string / FreeBSD / strcpy.3.patch
1 --- _SB/Libc/string/FreeBSD/strcpy.3 2003-05-20 15:23:54.000000000 -0700
2 +++ _SB/Libc/string/FreeBSD/strcpy.3.edit 2006-06-28 16:55:53.000000000 -0700
3 @@ -40,18 +40,30 @@
4 .Dt STRCPY 3
5 .Os
6 .Sh NAME
7 -.Nm strcpy , strncpy
8 +.Nm stpcpy ,
9 +.Nm strcpy ,
10 +.Nm strncpy
11 .Nd copy strings
12 .Sh LIBRARY
13 .Lb libc
14 .Sh SYNOPSIS
15 .In string.h
16 .Ft char *
17 -.Fn stpcpy "char *dst" "const char *src"
18 +.Fo stpcpy
19 +.Fa "char *s1"
20 +.Fa "const char *s2"
21 +.Fc
22 .Ft char *
23 -.Fn strcpy "char * restrict dst" "const char * restrict src"
24 +.Fo strcpy
25 +.Fa "char *restrict s1"
26 +.Fa "const char *restrict s2"
27 +.Fc
28 .Ft char *
29 -.Fn strncpy "char * restrict dst" "const char * restrict src" "size_t len"
30 +.Fo strncpy
31 +.Fa "char *restrict s1"
32 +.Fa "const char *restrict s2"
33 +.Fa "size_t n"
34 +.Fc
35 .Sh DESCRIPTION
36 The
37 .Fn stpcpy
38 @@ -59,33 +71,33 @@
39 .Fn strcpy
40 functions
41 copy the string
42 -.Fa src
43 +.Fa s2
44 to
45 -.Fa dst
46 +.Fa s1
47 (including the terminating
48 .Ql \e0
49 -character.)
50 +character).
51 .Pp
52 The
53 .Fn strncpy
54 function copies at most
55 -.Fa len
56 +.Fa n
57 characters from
58 -.Fa src
59 +.Fa s2
60 into
61 -.Fa dst .
62 +.Fa s1 .
63 If
64 -.Fa src
65 +.Fa s2
66 is less than
67 -.Fa len
68 +.Fa n
69 characters long,
70 the remainder of
71 -.Fa dst
72 +.Fa s1
73 is filled with
74 .Ql \e0
75 characters.
76 Otherwise,
77 -.Fa dst
78 +.Fa s1
79 is
80 .Em not
81 terminated.
82 @@ -96,13 +108,13 @@
83 .Fn strncpy
84 functions
85 return
86 -.Fa dst .
87 +.Fa s1 .
88 The
89 .Fn stpcpy
90 function returns a pointer to the terminating
91 .Ql \e0
92 character of
93 -.Fa dst .
94 +.Fa s1 .
95 .Sh EXAMPLES
96 The following sets
97 .Va chararray
98 @@ -128,7 +140,7 @@
99 .Em not
100 .Tn NUL
101 terminate
102 -.Va chararray
103 +.Va chararray ,
104 because the length of the source string is greater than or equal
105 to the length argument.
106 .Pp
107 @@ -159,7 +171,7 @@
108 .Pp
109 .Dl "(void)strlcpy(buf, input, sizeof(buf));"
110 .Pp
111 -Note that because
112 +Note that, because
113 .Xr strlcpy 3
114 is not defined in any standards, it should
115 only be used when portability is not a concern.
116 @@ -179,11 +191,6 @@
117 .Xr memcpy 3 ,
118 .Xr memmove 3 ,
119 .Xr strlcpy 3
120 -.Rs
121 -.%T "The FreeBSD Security Architecture"
122 -.Re
123 -(See
124 -.Pa "/usr/share/doc/{to be decided}" . )
125 .Sh STANDARDS
126 The
127 .Fn strcpy