From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED423CDB482 for ; Wed, 11 Oct 2023 20:39:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233360AbjJKUjY (ORCPT ); Wed, 11 Oct 2023 16:39:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233318AbjJKUjY (ORCPT ); Wed, 11 Oct 2023 16:39:24 -0400 Received: from mail.hallyn.com (mail.hallyn.com [178.63.66.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DA4A9E for ; Wed, 11 Oct 2023 13:39:21 -0700 (PDT) Received: by mail.hallyn.com (Postfix, from userid 1001) id A441C299; Wed, 11 Oct 2023 15:39:19 -0500 (CDT) Date: Wed, 11 Oct 2023 15:39:19 -0500 From: "Serge E. Hallyn" To: Alejandro Colomar Cc: serge@hallyn.com, linux-man@vger.kernel.org Subject: Re: string_copying.7: Clarifying ustr and zustr Message-ID: <20231011203919.GA52245@mail.hallyn.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-man@vger.kernel.org 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 > > -- >