summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strlcpy.3
diff options
context:
space:
mode:
authormillert <>2013-09-25 21:49:31 +0000
committermillert <>2013-09-25 21:49:31 +0000
commitd43fbdbe15661679852f61d404fabacd5aa30b48 (patch)
treee6b591457634e0ef31f70790dd43eb3915ca4b04 /src/lib/libc/string/strlcpy.3
parent2d453f9cfc595e35f9eb087dd002625195c31659 (diff)
downloadopenbsd-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/strlcpy.3')
-rw-r--r--src/lib/libc/string/strlcpy.310
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/libc/string/strlcpy.3 b/src/lib/libc/string/strlcpy.3
index a0028a52b1..a7cd269819 100644
--- a/src/lib/libc/string/strlcpy.3
+++ b/src/lib/libc/string/strlcpy.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: strlcpy.3,v 1.24 2013/07/16 15:21:11 schwarze Exp $ 1.\" $OpenBSD: strlcpy.3,v 1.25 2013/09/25 21:49:31 millert Exp $
2.\" 2.\"
3.\" Copyright (c) 1998, 2000 Todd C. Miller <Todd.Miller@courtesan.com> 3.\" Copyright (c) 1998, 2000 Todd C. Miller <Todd.Miller@courtesan.com>
4.\" 4.\"
@@ -14,7 +14,7 @@
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\" 16.\"
17.Dd $Mdocdate: July 16 2013 $ 17.Dd $Mdocdate: September 25 2013 $
18.Dt STRLCPY 3 18.Dt STRLCPY 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -80,6 +80,12 @@ as it means that either
80is incorrect or that 80is incorrect or that
81.Fa dst 81.Fa dst
82is not a proper string). 82is not a proper string).
83.Pp
84If the
85.Fa src
86and
87.Fa dst
88strings overlap, the behavior is undefined.
83.Sh RETURN VALUES 89.Sh RETURN VALUES
84Besides quibbles over the return type 90Besides quibbles over the return type
85.Pf ( Va size_t 91.Pf ( Va size_t