]> git.saurik.com Git - apple/libc.git/blob - string/FreeBSD/strcat.3.patch
Libc-498.tar.gz
[apple/libc.git] / string / FreeBSD / strcat.3.patch
1 --- _SB/Libc/string/FreeBSD/strcat.3 2003-05-20 15:23:54.000000000 -0700
2 +++ _SB/Libc/string/FreeBSD/strcat.3.edit 2006-06-28 16:55:53.000000000 -0700
3 @@ -40,16 +40,24 @@
4 .Dt STRCAT 3
5 .Os
6 .Sh NAME
7 -.Nm strcat
8 +.Nm strcat ,
9 +.Nm strncat
10 .Nd concatenate strings
11 .Sh LIBRARY
12 .Lb libc
13 .Sh SYNOPSIS
14 .In string.h
15 .Ft char *
16 -.Fn strcat "char * restrict s" "const char * restrict append"
17 +.Fo strcat
18 +.Fa "char *restrict s1"
19 +.Fa "const char *restrict s2"
20 +.Fc
21 .Ft char *
22 -.Fn strncat "char * restrict s" "const char * restrict append" "size_t count"
23 +.Fo strncat
24 +.Fa "char *restrict s1"
25 +.Fa "const char *restrict s2"
26 +.Fa "size_t n"
27 +.Fc
28 .Sh DESCRIPTION
29 The
30 .Fn strcat
31 @@ -57,22 +65,22 @@
32 .Fn strncat
33 functions
34 append a copy of the null-terminated string
35 -.Fa append
36 +.Fa s2
37 to the end of the null-terminated string
38 -.Fa s ,
39 +.Fa s1 ,
40 then add a terminating
41 .Ql \e0 .
42 The string
43 -.Fa s
44 +.Fa s1
45 must have sufficient space to hold the result.
46 .Pp
47 The
48 .Fn strncat
49 function
50 appends not more than
51 -.Fa count
52 +.Fa n
53 characters from
54 -.Fa append ,
55 +.Fa s2 ,
56 and then adds a terminating
57 .Ql \e0 .
58 .Sh RETURN VALUES
59 @@ -82,7 +90,7 @@
60 .Fn strncat
61 functions
62 return the pointer
63 -.Fa s .
64 +.Fa s1 .
65 .Sh SECURITY CONSIDERATIONS
66 The
67 .Fn strcat
68 @@ -114,7 +122,7 @@
69 void
70 foo(const char *arbitrary_string)
71 {
72 - char onstack[8];
73 + char onstack[8] = "";
74
75 #if defined(BAD)
76 /*
77 @@ -149,11 +157,6 @@
78 .Xr strcpy 3 ,
79 .Xr strlcat 3 ,
80 .Xr strlcpy 3
81 -.Rs
82 -.%T "The FreeBSD Security Architecture"
83 -.Re
84 -(See
85 -.Pa "/usr/share/doc/{to be decided}" . )
86 .Sh STANDARDS
87 The
88 .Fn strcat