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/stpcpy.3 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/lib/libc/string/stpcpy.3') diff --git a/src/lib/libc/string/stpcpy.3 b/src/lib/libc/string/stpcpy.3 index ed1b830b56..ea25610717 100644 --- a/src/lib/libc/string/stpcpy.3 +++ b/src/lib/libc/string/stpcpy.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: stpcpy.3,v 1.3 2013/06/05 03:39:23 tedu Exp $ +.\" $OpenBSD: stpcpy.3,v 1.4 2013/09/25 21:49:31 millert 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: June 5 2013 $ +.Dd $Mdocdate: September 25 2013 $ .Dt STPCPY 3 .Os .Sh NAME @@ -77,6 +77,12 @@ if the length of .Fa src is greater than or equal to .Fa len . +.Pp +If the +.Fa src +and +.Fa dst +strings overlap, the behavior is undefined. .Sh RETURN VALUES The .Fn stpcpy -- cgit v1.2.3-55-g6feb