From: "Serge E. Hallyn" <serge@hallyn.com>
To: Alejandro Colomar <alx@kernel.org>
Cc: serge@hallyn.com, linux-man@vger.kernel.org
Subject: Re: string_copying.7: Clarifying ustr and zustr
Date: Wed, 11 Oct 2023 15:39:19 -0500 [thread overview]
Message-ID: <20231011203919.GA52245@mail.hallyn.com> (raw)
In-Reply-To: <ZSVbASi04xwzNFyr@debian>
On Tue, Oct 10, 2023 at 04:09:05PM +0200, Alejandro Colomar wrote:
> Hi Serge,
>
> I'm clarifying zustr after your suggestion. Please check this text.
Thanks, this looks good.
> DESCRIPTION
> Terms (and abbreviations)
> string (str)
> is a sequence of zero or more non‐null characters fol‐
> lowed by a null byte.
>
> character sequence
> is a sequence of zero or more non‐null characters. A
> program should never use a character sequence where a
> string is required. However, with appropriate care, a
> string can be used in the place of a character sequence.
>
> null‐padded character sequence (zustr)
> Character sequences can be contained in fixed‐
> width buffers, which contain padding null bytes
> after the character sequence, to fill the rest of
> the buffer without affecting the character se‐
> quence; however, those padding null bytes are not
> part of the character sequence. zustr stands for
> Zero‐padded Unterminated STRing. Don’t confuse
> zero‐padded with null‐terminated: zero‐padded
> means 0 or more padding zeros (null characters),
> while null‐terminated means exactly 1 terminating
> null character.
>
> measured character sequence (ustr)
> Character sequence delimited by its length. It
> may be a slice of a larger character sequence, or
> even of a string. ustr stands for Unterminated
> STRing.
>
> The patch is:
>
> diff --git a/man7/string_copying.7 b/man7/string_copying.7
> index e03c2dda6..c5f374025 100644
> --- a/man7/string_copying.7
> +++ b/man7/string_copying.7
> @@ -102,12 +102,19 @@ .SS Terms (and abbreviations)
> to fill the rest of the buffer
> without affecting the character sequence;
> however, those padding null bytes are not part of the character sequence.
> +.I zustr
> +stands for Zero-padded Unterminated STRing.
> +Don't confuse zero-padded with null-terminated:
> +zero-padded means 0 or more padding zeros (null characters),
> +while null-terminated means exactly 1 terminating null character.
> .\" ----- DESCRIPTION :: Terms (and abbreviations) :: measured character sequence
> .TP
> .IR "measured character sequence " ( ustr )
> Character sequence delimited by its length.
> It may be a slice of a larger character sequence,
> or even of a string.
> +.I ustr
> +stands for Unterminated STRing.
> .RE
> .\" ----- DESCRIPTION :: Terms (and abbreviations) :: length (len) ----/
> .TP
>
>
> Thanks,
> Alex
>
> --
> <https://www.alejandro-colomar.es/>
next prev parent reply other threads:[~2023-10-11 20:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-10 14:09 string_copying.7: Clarifying ustr and zustr Alejandro Colomar
2023-10-11 20:39 ` Serge E. Hallyn [this message]
2023-10-12 0:34 ` Alejandro Colomar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231011203919.GA52245@mail.hallyn.com \
--to=serge@hallyn.com \
--cc=alx@kernel.org \
--cc=linux-man@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox