summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/memcpy.3
diff options
context:
space:
mode:
authordd <dd@FreeBSD.org>2002-01-07 06:03:37 +0000
committerdd <dd@FreeBSD.org>2002-01-07 06:03:37 +0000
commit8cf69c2918303b6cbc7f2010e69296b66ee7f27c (patch)
tree40be7b29895212e64ee19481cdb8bccd99e259c4 /lib/libc/string/memcpy.3
parente713e4684d847d0b931421554c947bb9d70c2538 (diff)
downloadFreeBSD-src-8cf69c2918303b6cbc7f2010e69296b66ee7f27c.zip
FreeBSD-src-8cf69c2918303b6cbc7f2010e69296b66ee7f27c.tar.gz
Suggest using memmove(3) if src and dst may overlap.
PR: 33298 Submitted by: Tim J. Robbins <tim@robbins.dropbear.id.au>
Diffstat (limited to 'lib/libc/string/memcpy.3')
-rw-r--r--lib/libc/string/memcpy.39
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/libc/string/memcpy.3 b/lib/libc/string/memcpy.3
index bc7d786..c970d7c 100644
--- a/lib/libc/string/memcpy.3
+++ b/lib/libc/string/memcpy.3
@@ -82,5 +82,10 @@ is implemented using
.Xr bcopy 3 ,
and therefore the strings may overlap.
On other systems, copying overlapping strings may produce surprises.
-A simpler solution is to not use
-.Fn memcpy .
+Programs intended to be portable should use
+.Xr memmove 3
+when
+.Fa src
+and
+.Fa dst
+may overlap.
OpenPOWER on IntegriCloud