summaryrefslogtreecommitdiff
path: root/lib/libc/string/stpcpy.3
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2013-09-25 21:49:32 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2013-09-25 21:49:32 +0000
commit6ba1facf997aa1bcbf74124c61290ab3be7e0927 (patch)
tree6e6a858dcf88250033a09c8f4a786ad1848bbd2b /lib/libc/string/stpcpy.3
parentd133037a4116d11b85ea4f43bbc13ab270e86fe0 (diff)
According to POSIX, if the src and dst strings overlap, the behavior
is undefined. Add a warning to that effect. OK deraadt@ jmc@
Diffstat (limited to 'lib/libc/string/stpcpy.3')
-rw-r--r--lib/libc/string/stpcpy.310
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libc/string/stpcpy.3 b/lib/libc/string/stpcpy.3
index ed1b830b56e..ea25610717d 100644
--- a/lib/libc/string/stpcpy.3
+++ b/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