diff options
author | millert <> | 2013-09-25 21:49:31 +0000 |
---|---|---|
committer | millert <> | 2013-09-25 21:49:31 +0000 |
commit | d43fbdbe15661679852f61d404fabacd5aa30b48 (patch) | |
tree | e6b591457634e0ef31f70790dd43eb3915ca4b04 /src/lib/libc/string/strcpy.3 | |
parent | 2d453f9cfc595e35f9eb087dd002625195c31659 (diff) | |
download | openbsd-d43fbdbe15661679852f61d404fabacd5aa30b48.tar.gz openbsd-d43fbdbe15661679852f61d404fabacd5aa30b48.tar.bz2 openbsd-d43fbdbe15661679852f61d404fabacd5aa30b48.zip |
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 'src/lib/libc/string/strcpy.3')
-rw-r--r-- | src/lib/libc/string/strcpy.3 | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/libc/string/strcpy.3 b/src/lib/libc/string/strcpy.3 index 409f4c61d4..798c7e8d99 100644 --- a/src/lib/libc/string/strcpy.3 +++ b/src/lib/libc/string/strcpy.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: strcpy.3,v 1.18 2013/07/17 05:42:11 schwarze Exp $ | 1 | .\" $OpenBSD: strcpy.3,v 1.19 2013/09/25 21:49:31 millert Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. | 3 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. |
@@ -31,7 +31,7 @@ | |||
31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
32 | .\" SUCH DAMAGE. | 32 | .\" SUCH DAMAGE. |
33 | .\" | 33 | .\" |
34 | .Dd $Mdocdate: July 17 2013 $ | 34 | .Dd $Mdocdate: September 25 2013 $ |
35 | .Dt STRCPY 3 | 35 | .Dt STRCPY 3 |
36 | .Os | 36 | .Os |
37 | .Sh NAME | 37 | .Sh NAME |
@@ -77,6 +77,12 @@ if the length of | |||
77 | .Fa src | 77 | .Fa src |
78 | is greater than or equal to | 78 | is greater than or equal to |
79 | .Fa len . | 79 | .Fa len . |
80 | .Pp | ||
81 | If the | ||
82 | .Fa src | ||
83 | and | ||
84 | .Fa dst | ||
85 | strings overlap, the behavior is undefined. | ||
80 | .Sh RETURN VALUES | 86 | .Sh RETURN VALUES |
81 | The | 87 | The |
82 | .Fn strcpy | 88 | .Fn strcpy |