From 8d8738cfc75fe792339f17db58c10fd134baceec Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Tue, 4 Jun 2013 03:02:09 +0000 Subject: [PATCH] remove some incredible lies about overlapping buffers ok guenther --- src/lib/libc/string/memcpy.3 | 16 +++++----------- src/lib/libc/string/wmemcpy.3 | 16 +++++----------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/lib/libc/string/memcpy.3 b/src/lib/libc/string/memcpy.3 index e95d670a..51c458ee 100644 --- a/src/lib/libc/string/memcpy.3 +++ b/src/lib/libc/string/memcpy.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: memcpy.3,v 1.8 2011/07/25 00:38:52 schwarze Exp $ +.\" $OpenBSD: memcpy.3,v 1.9 2013/06/04 03:02:09 deraadt Exp $ .\" .\" Copyright (c) 1990, 1991 The Regents of the University of California. .\" All rights reserved. @@ -31,7 +31,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: July 25 2011 $ +.Dd $Mdocdate: June 4 2013 $ .Dt MEMCPY 3 .Os .Sh NAME @@ -50,6 +50,9 @@ bytes from buffer .Fa src to buffer .Fa dst . +If the two buffers may overlap, +.Xr memmove 3 +must be used instead. .Sh RETURN VALUES The .Fn memcpy @@ -74,12 +77,3 @@ function first appeared in .At V and was reimplemented for .Bx 4.3 Tahoe . -.Sh CAVEATS -In this implementation -.Fn memcpy -is implemented using -.Xr bcopy 3 , -and therefore the buffers may overlap. -On other systems, copying overlapping buffers may produce surprises. -A portable, safe solution is to use -.Xr memmove 3 . diff --git a/src/lib/libc/string/wmemcpy.3 b/src/lib/libc/string/wmemcpy.3 index 1102640a..4bbab290 100644 --- a/src/lib/libc/string/wmemcpy.3 +++ b/src/lib/libc/string/wmemcpy.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: wmemcpy.3,v 1.3 2011/07/25 00:38:53 schwarze Exp $ +.\" $OpenBSD: wmemcpy.3,v 1.4 2013/06/04 03:02:09 deraadt Exp $ .\" .\" Copyright (c) 1990, 1991 The Regents of the University of California. .\" All rights reserved. @@ -31,7 +31,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: July 25 2011 $ +.Dd $Mdocdate: June 4 2013 $ .Dt WMEMCPY 3 .Os .Sh NAME @@ -50,6 +50,9 @@ wide characters from buffer .Fa src to buffer .Fa dst . +If the two buffers may overlap, +.Xr wmemmove 3 +must be used instead. .Sh RETURN VALUES The .Fn wmemcpy @@ -74,12 +77,3 @@ function was ported from .Nx and first appeared in .Ox 3.8 . -.Sh CAVEATS -In this implementation -.Fn wmemcpy -is implemented using -.Xr bcopy 3 , -and therefore the buffers may overlap. -On other systems, copying overlapping buffers may produce surprises. -A portable, safe solution is to use -.Xr wmemmove 3 .