diff options
| author | millert <> | 2013-09-25 21:49:31 +0000 |
|---|---|---|
| committer | millert <> | 2013-09-25 21:49:31 +0000 |
| commit | eb478607074f73bee69915a1029c6bbc9bf7e5b2 (patch) | |
| tree | e6b591457634e0ef31f70790dd43eb3915ca4b04 /src/lib/libc/string/stpcpy.3 | |
| parent | 850287b4bedee537be8a8661aa243c8ffe8ec9e5 (diff) | |
| download | openbsd-eb478607074f73bee69915a1029c6bbc9bf7e5b2.tar.gz openbsd-eb478607074f73bee69915a1029c6bbc9bf7e5b2.tar.bz2 openbsd-eb478607074f73bee69915a1029c6bbc9bf7e5b2.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 '')
| -rw-r--r-- | src/lib/libc/string/stpcpy.3 | 10 |
1 files changed, 8 insertions, 2 deletions
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 @@ | |||
| 1 | .\" $OpenBSD: stpcpy.3,v 1.3 2013/06/05 03:39:23 tedu Exp $ | 1 | .\" $OpenBSD: stpcpy.3,v 1.4 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: June 5 2013 $ | 34 | .Dd $Mdocdate: September 25 2013 $ |
| 35 | .Dt STPCPY 3 | 35 | .Dt STPCPY 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 stpcpy | 88 | .Fn stpcpy |
