diff options
Diffstat (limited to 'src/lib/libc/string/strlcpy.3')
| -rw-r--r-- | src/lib/libc/string/strlcpy.3 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libc/string/strlcpy.3 b/src/lib/libc/string/strlcpy.3 index 52026669ea..b07e30e6ea 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.5 1999/06/06 15:17:32 aaron Exp $ | 1 | .\" $OpenBSD: strlcpy.3,v 1.6 1999/09/04 02:22:46 pjanzen Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .\" Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> | 3 | .\" Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> |
| 4 | .\" All rights reserved. | 4 | .\" All rights reserved. |
| @@ -101,7 +101,7 @@ The following code fragment illustrates the simple case: | |||
| 101 | .Bd -literal -offset indent | 101 | .Bd -literal -offset indent |
| 102 | char *s, *p, buf[BUFSIZ]; | 102 | char *s, *p, buf[BUFSIZ]; |
| 103 | 103 | ||
| 104 | .Li ... | 104 | \&... |
| 105 | 105 | ||
| 106 | (void)strlcpy(buf, s, sizeof(buf)); | 106 | (void)strlcpy(buf, s, sizeof(buf)); |
| 107 | (void)strlcat(buf, p, sizeof(buf)); | 107 | (void)strlcat(buf, p, sizeof(buf)); |
| @@ -112,7 +112,7 @@ like the following might be used: | |||
| 112 | .Bd -literal -offset indent | 112 | .Bd -literal -offset indent |
| 113 | char *dir, *file, pname[MAXPATHNAMELEN]; | 113 | char *dir, *file, pname[MAXPATHNAMELEN]; |
| 114 | 114 | ||
| 115 | .Li ... | 115 | \&... |
| 116 | 116 | ||
| 117 | if (strlcpy(pname, dir, sizeof(pname)) >= sizeof(pname)) | 117 | if (strlcpy(pname, dir, sizeof(pname)) >= sizeof(pname)) |
| 118 | goto toolong; | 118 | goto toolong; |
| @@ -126,7 +126,7 @@ speed things up a bit by using a copy instead on an append: | |||
| 126 | char *dir, *file, pname[MAXPATHNAMELEN]; | 126 | char *dir, *file, pname[MAXPATHNAMELEN]; |
| 127 | size_t n; | 127 | size_t n; |
| 128 | 128 | ||
| 129 | .Li ... | 129 | \&... |
| 130 | 130 | ||
| 131 | n = strlcpy(pname, dir, sizeof(pname)); | 131 | n = strlcpy(pname, dir, sizeof(pname)); |
| 132 | if (n >= sizeof(pname)) | 132 | if (n >= sizeof(pname)) |
