diff options
author | jaredy <> | 2005-08-06 03:21:36 +0000 |
---|---|---|
committer | jaredy <> | 2005-08-06 03:21:36 +0000 |
commit | 688d6cbb33ef71f63fab8688e85ac2f7aeb7b164 (patch) | |
tree | 77512edbdfbc7521fca9b386450af369c7b4ee75 /src | |
parent | 932da6a5c29178852f64fcd9163a9ea6b06cd011 (diff) | |
download | openbsd-688d6cbb33ef71f63fab8688e85ac2f7aeb7b164.tar.gz openbsd-688d6cbb33ef71f63fab8688e85ac2f7aeb7b164.tar.bz2 openbsd-688d6cbb33ef71f63fab8688e85ac2f7aeb7b164.zip |
- macro, punctuation, and rewording tweaks
- avoid first person.
ok jmc
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libc/string/strcat.3 | 12 | ||||
-rw-r--r-- | src/lib/libc/string/strcpy.3 | 7 | ||||
-rw-r--r-- | src/lib/libc/string/strlcpy.3 | 12 | ||||
-rw-r--r-- | src/lib/libc/string/wcstok.3 | 8 |
4 files changed, 21 insertions, 18 deletions
diff --git a/src/lib/libc/string/strcat.3 b/src/lib/libc/string/strcat.3 index 89d368c3fb..b81e724917 100644 --- a/src/lib/libc/string/strcat.3 +++ b/src/lib/libc/string/strcat.3 | |||
@@ -29,7 +29,7 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: strcat.3,v 1.10 2005/02/25 03:12:44 cloder Exp $ | 32 | .\" $OpenBSD: strcat.3,v 1.11 2005/08/06 03:21:36 jaredy Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd July 8, 1997 | 34 | .Dd July 8, 1997 |
35 | .Dt STRCAT 3 | 35 | .Dt STRCAT 3 |
@@ -78,7 +78,7 @@ functions return the pointer | |||
78 | The following appends | 78 | The following appends |
79 | .Dq Li abc | 79 | .Dq Li abc |
80 | to | 80 | to |
81 | .Dq Li chararray : | 81 | .Va chararray : |
82 | .Bd -literal -offset indent | 82 | .Bd -literal -offset indent |
83 | char *letters = "abcdefghi"; | 83 | char *letters = "abcdefghi"; |
84 | 84 | ||
@@ -99,11 +99,13 @@ buf[sizeof(buf) - 1] = '\e0'; | |||
99 | .Ed | 99 | .Ed |
100 | .Pp | 100 | .Pp |
101 | The above will copy as many characters from | 101 | The above will copy as many characters from |
102 | .Dq Li input | 102 | .Va input |
103 | to | 103 | to |
104 | .Dq Li buf | 104 | .Va buf |
105 | as will fit. | 105 | as will fit. |
106 | It then appends as many characters from suffix as will fit (or none | 106 | It then appends as many characters from |
107 | .Va suffix | ||
108 | as will fit (or none | ||
107 | if there is no space). | 109 | if there is no space). |
108 | For operations like this, the | 110 | For operations like this, the |
109 | .Xr strlcpy 3 | 111 | .Xr strlcpy 3 |
diff --git a/src/lib/libc/string/strcpy.3 b/src/lib/libc/string/strcpy.3 index 504f42f2ba..2bc413c6ca 100644 --- a/src/lib/libc/string/strcpy.3 +++ b/src/lib/libc/string/strcpy.3 | |||
@@ -29,7 +29,7 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: strcpy.3,v 1.13 2005/02/25 03:12:44 cloder Exp $ | 32 | .\" $OpenBSD: strcpy.3,v 1.14 2005/08/06 03:21:36 jaredy Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd June 29, 1991 | 34 | .Dd June 29, 1991 |
35 | .Dt STRCPY 3 | 35 | .Dt STRCPY 3 |
@@ -100,7 +100,8 @@ and does | |||
100 | .Em not | 100 | .Em not |
101 | NUL terminate | 101 | NUL terminate |
102 | .Va chararray | 102 | .Va chararray |
103 | because the source string is >= the length parameter. | 103 | because the length of the source string is greater than or equal to the |
104 | length parameter. | ||
104 | .Fn strncpy | 105 | .Fn strncpy |
105 | .Em only | 106 | .Em only |
106 | NUL terminates the destination string when the length of the source | 107 | NUL terminates the destination string when the length of the source |
@@ -118,7 +119,7 @@ Because | |||
118 | .Fn strncpy | 119 | .Fn strncpy |
119 | does | 120 | does |
120 | .Em not | 121 | .Em not |
121 | guarantee to NUL terminate the string itself, we must do this by hand. | 122 | guarantee to NUL terminate the string itself, it must be done by hand. |
122 | .Bd -literal -offset indent | 123 | .Bd -literal -offset indent |
123 | char buf[BUFSIZ]; | 124 | char buf[BUFSIZ]; |
124 | 125 | ||
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 , |
50 | as long as there is at least one byte free in | 50 | as long as there is at least one byte free in |
51 | .Fa dst ) . | 51 | .Fa dst ) . |
52 | Note that you should include a byte for the NUL in | 52 | Note that a byte for the NUL should be included in |
53 | .Fa size . | 53 | .Fa size . |
54 | Also note that | 54 | Also note that |
55 | .Fn strlcpy | 55 | .Fn strlcpy |
@@ -105,10 +105,10 @@ that means the initial length of | |||
105 | plus | 105 | plus |
106 | the length of | 106 | the length of |
107 | .Fa src . | 107 | .Fa src . |
108 | While this may seem somewhat confusing it was done to make | 108 | While this may seem somewhat confusing, it was done to make |
109 | truncation detection simple. | 109 | truncation detection simple. |
110 | .Pp | 110 | .Pp |
111 | Note however, that if | 111 | Note, however, that if |
112 | .Fn strlcat | 112 | .Fn strlcat |
113 | traverses | 113 | traverses |
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 |
155 | Since we know how many characters we copied the first time, we can | 155 | Since it is known how many characters were copied the first time, things |
156 | speed things up a bit by using a copy instead of an append: | 156 | can be sped up a bit by using a copy instead of an append: |
157 | .Bd -literal -offset indent | 157 | .Bd -literal -offset indent |
158 | char *dir, *file, pname[MAXPATHLEN]; | 158 | char *dir, *file, pname[MAXPATHLEN]; |
159 | size_t n; | 159 | size_t n; |
diff --git a/src/lib/libc/string/wcstok.3 b/src/lib/libc/string/wcstok.3 index dd3f36cfd5..28291888f5 100644 --- a/src/lib/libc/string/wcstok.3 +++ b/src/lib/libc/string/wcstok.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: wcstok.3,v 1.2 2005/04/13 20:42:48 jmc Exp $ | 1 | .\" $OpenBSD: wcstok.3,v 1.3 2005/08/06 03:21:36 jaredy Exp $ |
2 | .\" | 2 | .\" |
3 | .\" $NetBSD: wcstok.3,v 1.3 2003/09/08 17:54:33 wiz Exp $ | 3 | .\" $NetBSD: wcstok.3,v 1.3 2003/09/08 17:54:33 wiz Exp $ |
4 | .\" | 4 | .\" |
@@ -68,7 +68,7 @@ | |||
68 | The | 68 | The |
69 | .Fn wcstok | 69 | .Fn wcstok |
70 | function | 70 | function |
71 | is used to isolate sequential tokens in a null-terminated wide character | 71 | is used to isolate sequential tokens in a NUL-terminated wide character |
72 | string, | 72 | string, |
73 | .Fa str . | 73 | .Fa str . |
74 | These tokens are separated in the string by at least one of the | 74 | These tokens are separated in the string by at least one of the |
@@ -97,12 +97,12 @@ The | |||
97 | .Fn wcstok | 97 | .Fn wcstok |
98 | function | 98 | function |
99 | returns a pointer to the beginning of each subsequent token in the string, | 99 | returns a pointer to the beginning of each subsequent token in the string, |
100 | after replacing the token itself with a null wide character (L'\e0'). | 100 | after replacing the token itself with a NUL wide character (L'\e0'). |
101 | When no more tokens remain, a null pointer is returned. | 101 | When no more tokens remain, a null pointer is returned. |
102 | .Sh EXAMPLES | 102 | .Sh EXAMPLES |
103 | The following code fragment splits a wide character string on | 103 | The following code fragment splits a wide character string on |
104 | .Tn ASCII | 104 | .Tn ASCII |
105 | space, tab and newline characters and writes the tokens to | 105 | space, tab, and newline characters and writes the tokens to |
106 | standard output: | 106 | standard output: |
107 | .Bd -literal -offset indent | 107 | .Bd -literal -offset indent |
108 | const wchar_t *seps = L" \et\en"; | 108 | const wchar_t *seps = L" \et\en"; |