X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/7b00c0c43f52e9d27168e67a26aac19065cdb40c..ad3c9f2af814c84582fdd1649e49ec4f68572c5a:/string/FreeBSD/strcat.3 diff --git a/string/FreeBSD/strcat.3 b/string/FreeBSD/strcat.3 index 00d0788..9eb86ec 100644 --- a/string/FreeBSD/strcat.3 +++ b/string/FreeBSD/strcat.3 @@ -44,9 +44,16 @@ .Sh SYNOPSIS .In string.h .Ft char * -.Fn strcat "char * restrict s" "const char * restrict append" +.Fo strcat +.Fa "char *restrict s1" +.Fa "const char *restrict s2" +.Fc .Ft char * -.Fn strncat "char * restrict s" "const char * restrict append" "size_t count" +.Fo strncat +.Fa "char *restrict s1" +.Fa "const char *restrict s2" +.Fa "size_t n" +.Fc .Sh DESCRIPTION The .Fn strcat @@ -54,24 +61,27 @@ and .Fn strncat functions append a copy of the null-terminated string -.Fa append +.Fa s2 to the end of the null-terminated string -.Fa s , +.Fa s1 , then add a terminating .Ql \e0 . The string -.Fa s +.Fa s1 must have sufficient space to hold the result. .Pp The .Fn strncat function appends not more than -.Fa count +.Fa n characters from -.Fa append , +.Fa s2 , and then adds a terminating .Ql \e0 . +.Pp +The source and destination strings should not overlap, as the +behavior is undefined. .Sh RETURN VALUES The .Fn strcat @@ -79,7 +89,7 @@ and .Fn strncat functions return the pointer -.Fa s . +.Fa s1 . .Sh SECURITY CONSIDERATIONS The .Fn strcat @@ -111,7 +121,7 @@ Example: void foo(const char *arbitrary_string) { - char onstack[8]; + char onstack[8] = ""; #if defined(BAD) /*