diff options
author | 2002-05-13 17:04:43 +0000 | |
---|---|---|
committer | 2002-05-13 17:04:43 +0000 | |
commit | ff111f5e9b15b774f7e8f792732b6eee38f7191c (patch) | |
tree | 7fa70990ad19cec23ac762bdc242b3aaa27eff70 /lib/libc/string | |
parent | Only print usage for the command that was run (at, atq, atrm, batch), not (diff) | |
download | wireguard-openbsd-ff111f5e9b15b774f7e8f792732b6eee38f7191c.tar.xz wireguard-openbsd-ff111f5e9b15b774f7e8f792732b6eee38f7191c.zip |
For strncpy(), dst is not NUL terminated if strlen(src) >= len.
Also fix a typo; adapted from a patch by Moritz Jodeit
Diffstat (limited to 'lib/libc/string')
-rw-r--r-- | lib/libc/string/strcpy.3 | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/libc/string/strcpy.3 b/lib/libc/string/strcpy.3 index 1dbeafa6e86..d3c095916ba 100644 --- a/lib/libc/string/strcpy.3 +++ b/lib/libc/string/strcpy.3 @@ -33,7 +33,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: strcpy.3,v 1.10 2000/04/21 15:24:20 aaron Exp $ +.\" $OpenBSD: strcpy.3,v 1.11 2002/05/13 17:04:43 millert Exp $ .\" .Dd June 29, 1991 .Dt STRCPY 3 @@ -76,11 +76,10 @@ characters long, and .Em not terminating .Fa dst -if +if the length of .Fa src -is more than -.Fa len -characters long. +is greater than or equal to +.Fa len . .Sh RETURN VALUES The .Fn strcpy @@ -108,7 +107,7 @@ null terminate because the source string is >= the length parameter. .Fn strncpy .Em only -null terminates the destination string when then length of the source +null terminates the destination string when the length of the source string is less than the length parameter. .Bd -literal -offset indent (void)strncpy(chararray, "abcdefgh", 6); |