summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/wcscpy.3
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2011-07-25 00:38:52 +0000
committerschwarze <schwarze@openbsd.org>2011-07-25 00:38:52 +0000
commit8c40de08f9d12a182e23e357bcca21c5be683dd9 (patch)
treedf554e154d9ded444e70f01eb8a84b1212071f78 /lib/libc/string/wcscpy.3
parentoccured -> occurred; (diff)
downloadwireguard-openbsd-8c40de08f9d12a182e23e357bcca21c5be683dd9.tar.xz
wireguard-openbsd-8c40de08f9d12a182e23e357bcca21c5be683dd9.zip
update HISTORY and SEE ALSO for all of string(3), together with various
smaller improvements; jmc@ and nicm@ both ask me to get this in because further tweaking will be easier in-tree
Diffstat (limited to 'lib/libc/string/wcscpy.3')
-rw-r--r--lib/libc/string/wcscpy.334
1 files changed, 30 insertions, 4 deletions
diff --git a/lib/libc/string/wcscpy.3 b/lib/libc/string/wcscpy.3
index a71d54f886a..dcc375acbf1 100644
--- a/lib/libc/string/wcscpy.3
+++ b/lib/libc/string/wcscpy.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wcscpy.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wcscpy.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WCSCPY 3
.Os
.Sh NAME
@@ -51,7 +51,9 @@
.Sh DESCRIPTION
The
.Fn wcscpy
-function copies the wide string
+and
+.Fn wcsncpy
+functions copy the wide string
.Fa src
to
.Fa dst
@@ -83,6 +85,9 @@ and
functions return
.Fa dst .
.Sh SEE ALSO
+.Xr strcpy 3 ,
+.Xr strlcpy 3 ,
+.Xr wcscat 3 ,
.Xr wcslcpy 3 ,
.Xr wmemcpy 3 ,
.Xr wmemmove 3
@@ -95,3 +100,24 @@ functions conform to
.St -isoC-99
and were first introduced in
.St -isoC-amd1 .
+.Sh HISTORY
+The
+.Fn wcscpy
+and
+.Fn wcsncpy
+functions were ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
+.Sh CAVEATS
+Using the functions
+.Fn wcscpy
+and
+.Fn wcsncpy
+is very error-prone with respect to buffer overflows;
+see the EXAMPLES section in
+.Xr strcpy 3
+for correct usage.
+Using
+.Xr wcslcpy 3
+is a better choice in most cases.