summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strlcpy.3
diff options
context:
space:
mode:
authorjaredy <>2005-08-06 03:21:36 +0000
committerjaredy <>2005-08-06 03:21:36 +0000
commit688d6cbb33ef71f63fab8688e85ac2f7aeb7b164 (patch)
tree77512edbdfbc7521fca9b386450af369c7b4ee75 /src/lib/libc/string/strlcpy.3
parent932da6a5c29178852f64fcd9163a9ea6b06cd011 (diff)
downloadopenbsd-688d6cbb33ef71f63fab8688e85ac2f7aeb7b164.tar.gz
openbsd-688d6cbb33ef71f63fab8688e85ac2f7aeb7b164.tar.bz2
openbsd-688d6cbb33ef71f63fab8688e85ac2f7aeb7b164.zip
- macro, punctuation, and rewording tweaks
- avoid first person. ok jmc
Diffstat (limited to 'src/lib/libc/string/strlcpy.3')
-rw-r--r--src/lib/libc/string/strlcpy.312
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libc/string/strlcpy.3 b/src/lib/libc/string/strlcpy.3
index b392588879..c728c75e51 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.16 2003/06/17 21:56:24 millert Exp $ 1.\" $OpenBSD: strlcpy.3,v 1.17 2005/08/06 03:21:36 jaredy 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.\"
@@ -49,7 +49,7 @@ is larger than 0 or, in the case of
49.Fn strlcat , 49.Fn strlcat ,
50as long as there is at least one byte free in 50as long as there is at least one byte free in
51.Fa dst ) . 51.Fa dst ) .
52Note that you should include a byte for the NUL in 52Note that a byte for the NUL should be included in
53.Fa size . 53.Fa size .
54Also note that 54Also note that
55.Fn strlcpy 55.Fn strlcpy
@@ -105,10 +105,10 @@ that means the initial length of
105plus 105plus
106the length of 106the length of
107.Fa src . 107.Fa src .
108While this may seem somewhat confusing it was done to make 108While this may seem somewhat confusing, it was done to make
109truncation detection simple. 109truncation detection simple.
110.Pp 110.Pp
111Note however, that if 111Note, however, that if
112.Fn strlcat 112.Fn strlcat
113traverses 113traverses
114.Fa size 114.Fa size
@@ -152,8 +152,8 @@ if (strlcat(pname, file, sizeof(pname)) >= sizeof(pname))
152 goto toolong; 152 goto toolong;
153.Ed 153.Ed
154.Pp 154.Pp
155Since we know how many characters we copied the first time, we can 155Since it is known how many characters were copied the first time, things
156speed things up a bit by using a copy instead of an append: 156can be sped up a bit by using a copy instead of an append:
157.Bd -literal -offset indent 157.Bd -literal -offset indent
158char *dir, *file, pname[MAXPATHLEN]; 158char *dir, *file, pname[MAXPATHLEN];
159size_t n; 159size_t n;