strcpy(3), strlcpy(3), strncpy(3): Just say `byte', not `character'.

This commit is contained in:
riastradh 2023-08-11 21:17:16 +00:00
parent 312767bb97
commit 13b8c448a3
3 changed files with 13 additions and 13 deletions

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)strcpy.3 8.1 (Berkeley) 6/4/93
.\" $NetBSD: strcpy.3,v 1.26 2023/08/11 16:05:56 riastradh Exp $
.\" $NetBSD: strcpy.3,v 1.27 2023/08/11 21:17:16 riastradh Exp $
.\"
.Dd August 11, 2023
.Dt STRCPY 3
@ -59,7 +59,7 @@ to
.Fa dst ,
including the terminating
.Tn NUL
character.
byte.
.Pp
The strings
.Fa src
@ -70,7 +70,7 @@ The string
.Fa src
must be terminated by a
.Tn NUL
character.
byte.
The memory for
.Fa dst
must have space for
@ -86,7 +86,7 @@ The
.Fn stpcpy
function returns a pointer to the terminating
.Tn NUL
character of
byte of
.Fa dst .
.Sh SEE ALSO
.Xr bcopy 3 ,

View File

@ -1,4 +1,4 @@
.\" $NetBSD: strlcpy.3,v 1.18 2023/08/11 16:34:28 riastradh Exp $
.\" $NetBSD: strlcpy.3,v 1.19 2023/08/11 21:17:16 riastradh Exp $
.\" from OpenBSD: strlcpy.3,v 1.11 2000/11/16 23:27:41 angelos Exp
.\"
.\" Copyright (c) 1998, 2000 Todd C. Miller <Todd.Miller@courtesan.com>
@ -54,7 +54,7 @@ The
.Fn strlcpy
function copies up to
.Fa size
- 1 characters from the
- 1 bytes from the
.Tn NUL Ns -terminated
string
.Fa src
@ -175,7 +175,7 @@ Note however, that if
.Fn strlcat
traverses
.Fa size
characters without finding a
bytes without finding a
.Tn NUL ,
the length of the string is considered to be
.Fa size
@ -217,7 +217,7 @@ if (strlcat(pname, file, sizeof(pname)) >= sizeof(pname))
goto toolong;
.Ed
.Pp
Since we know how many characters we copied the first time, we can
Since we know how many bytes we copied the first time, we can
speed things up a bit by using a copy instead of an append:
.Bd -literal -offset indent
char *dir, *file, pname[MAXPATHLEN];

View File

@ -31,7 +31,7 @@
.\"
.\" from: @(#)strcpy.3 8.1 (Berkeley) 6/4/93
.\" from: NetBSD: strcpy.3,v 1.23 2015/04/01 20:18:17 riastradh Exp
.\" $NetBSD: strncpy.3,v 1.12 2023/08/11 21:12:10 riastradh Exp $
.\" $NetBSD: strncpy.3,v 1.13 2023/08/11 21:17:16 riastradh Exp $
.\"
.Dd August 11, 2023
.Dt STRNCPY 3
@ -136,7 +136,7 @@ appear on disk with the content of a caller-provided string
.Dv str ,
padded to the end of the field with
.Tn NUL
characters:
bytes:
.Bd -literal -offset indent
struct record {
uint16_t id;
@ -168,7 +168,7 @@ Note that when
.Dv str
has at least six
.No non- Ns Tn NUL
characters,
bytes,
.Dv rec Ns Li "->name"
is
.Em not
@ -184,12 +184,12 @@ has
.Em more
than six
.No non- Ns Tn NUL
characters, the additional ones are truncated.
bytes, the additional ones are truncated.
If
.Dv str
has space for
.Em fewer
than six characters, and the last one is not
than six bytes, and the last one is not
.Tn NUL ,
using
.Fn strncpy