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/memccpy.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/memccpy.3')
-rw-r--r-- | src/lib/libc/string/memccpy.3 | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/libc/string/memccpy.3 b/src/lib/libc/string/memccpy.3 index 076e8f64ab..98326d6871 100644 --- a/src/lib/libc/string/memccpy.3 +++ b/src/lib/libc/string/memccpy.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: memccpy.3,v 1.11 2013/06/05 03:39:23 tedu Exp $ | 1 | .\" $OpenBSD: memccpy.3,v 1.12 2013/09/25 21:49:30 millert Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 1990, 1991, 1993 | 3 | .\" Copyright (c) 1990, 1991, 1993 |
4 | .\" The Regents of the University of California. All rights reserved. | 4 | .\" The Regents of the University of California. All rights reserved. |
@@ -29,7 +29,7 @@ | |||
29 | .\" | 29 | .\" |
30 | .\" @(#)memccpy.3 8.1 (Berkeley) 6/9/93 | 30 | .\" @(#)memccpy.3 8.1 (Berkeley) 6/9/93 |
31 | .\" | 31 | .\" |
32 | .Dd $Mdocdate: June 5 2013 $ | 32 | .Dd $Mdocdate: September 25 2013 $ |
33 | .Dt MEMCCPY 3 | 33 | .Dt MEMCCPY 3 |
34 | .Os | 34 | .Os |
35 | .Sh NAME | 35 | .Sh NAME |
@@ -60,6 +60,12 @@ is returned. | |||
60 | Otherwise, | 60 | Otherwise, |
61 | .Fa len | 61 | .Fa len |
62 | bytes are copied, and a null pointer is returned. | 62 | bytes are copied, and a null pointer is returned. |
63 | .Pp | ||
64 | If the | ||
65 | .Fa src | ||
66 | and | ||
67 | .Fa dst | ||
68 | strings overlap, the behavior is undefined. | ||
63 | .Sh SEE ALSO | 69 | .Sh SEE ALSO |
64 | .Xr bcopy 3 , | 70 | .Xr bcopy 3 , |
65 | .Xr memcpy 3 , | 71 | .Xr memcpy 3 , |