]> git.saurik.com Git - apple/libc.git/blob - string/FreeBSD/strcat.3.patch
Libc-763.12.tar.gz
[apple/libc.git] / string / FreeBSD / strcat.3.patch
1 --- strcat.3.orig 2010-06-17 08:44:44.000000000 -0700
2 +++ strcat.3 2010-06-17 08:46:22.000000000 -0700
3 @@ -44,9 +44,16 @@
4 .Sh SYNOPSIS
5 .In string.h
6 .Ft char *
7 -.Fn strcat "char * restrict s" "const char * restrict append"
8 +.Fo strcat
9 +.Fa "char *restrict s1"
10 +.Fa "const char *restrict s2"
11 +.Fc
12 .Ft char *
13 -.Fn strncat "char * restrict s" "const char * restrict append" "size_t count"
14 +.Fo strncat
15 +.Fa "char *restrict s1"
16 +.Fa "const char *restrict s2"
17 +.Fa "size_t n"
18 +.Fc
19 .Sh DESCRIPTION
20 The
21 .Fn strcat
22 @@ -54,24 +61,27 @@ and
23 .Fn strncat
24 functions
25 append a copy of the null-terminated string
26 -.Fa append
27 +.Fa s2
28 to the end of the null-terminated string
29 -.Fa s ,
30 +.Fa s1 ,
31 then add a terminating
32 .Ql \e0 .
33 The string
34 -.Fa s
35 +.Fa s1
36 must have sufficient space to hold the result.
37 .Pp
38 The
39 .Fn strncat
40 function
41 appends not more than
42 -.Fa count
43 +.Fa n
44 characters from
45 -.Fa append ,
46 +.Fa s2 ,
47 and then adds a terminating
48 .Ql \e0 .
49 +.Pp
50 +The source and destination strings should not overlap, as the
51 +behavior is undefined.
52 .Sh RETURN VALUES
53 The
54 .Fn strcat
55 @@ -79,7 +89,7 @@ and
56 .Fn strncat
57 functions
58 return the pointer
59 -.Fa s .
60 +.Fa s1 .
61 .Sh SECURITY CONSIDERATIONS
62 The
63 .Fn strcat
64 @@ -111,7 +121,7 @@ Example:
65 void
66 foo(const char *arbitrary_string)
67 {
68 - char onstack[8];
69 + char onstack[8] = "";
70
71 #if defined(BAD)
72 /*