From d43fbdbe15661679852f61d404fabacd5aa30b48 Mon Sep 17 00:00:00 2001 From: millert <> Date: Wed, 25 Sep 2013 21:49:31 +0000 Subject: According to POSIX, if the src and dst strings overlap, the behavior is undefined. Add a warning to that effect. OK deraadt@ jmc@ --- src/lib/libc/string/memccpy.3 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/lib/libc/string/memccpy.3') diff --git a/src/lib/libc/string/memccpy.3 b/src/lib/libc/string/memccpy.3 index 076e8f64ab..98326d6871 100644 --- a/src/lib/libc/string/memccpy.3 +++ b/src/lib/libc/string/memccpy.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: memccpy.3,v 1.11 2013/06/05 03:39:23 tedu Exp $ +.\" $OpenBSD: memccpy.3,v 1.12 2013/09/25 21:49:30 millert Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)memccpy.3 8.1 (Berkeley) 6/9/93 .\" -.Dd $Mdocdate: June 5 2013 $ +.Dd $Mdocdate: September 25 2013 $ .Dt MEMCCPY 3 .Os .Sh NAME @@ -60,6 +60,12 @@ is returned. Otherwise, .Fa len bytes are copied, and a null pointer is returned. +.Pp +If the +.Fa src +and +.Fa dst +strings overlap, the behavior is undefined. .Sh SEE ALSO .Xr bcopy 3 , .Xr memcpy 3 , -- cgit v1.2.3-55-g6feb