From: Alejandro Colomar <alx@kernel.org>
To: Andriy Utkin <andriy_utkin@fastmail.com>
Cc: linux-man@vger.kernel.org
Subject: Re: [PATCH] mbsrtowcs.3: add a note for conversion completion
Date: Tue, 14 Nov 2023 11:04:46 +0100 [thread overview]
Message-ID: <ZVNGPmVfB5EOgXdA@debian> (raw)
In-Reply-To: <ZVNCOHFFdSGn593o@dell>
[-- Attachment #1: Type: text/plain, Size: 1771 bytes --]
Hi Andriy,
On Tue, Nov 14, 2023 at 09:47:36AM +0000, Andriy Utkin wrote:
> On Tue, Nov 14, 2023 at 10:21:27AM +0100, Alejandro Colomar wrote:
> > mbstowcs(3) has the following:
> >
> > In order to avoid the case 2 above, the programmer should make
> > sure n is greater than or equal to mbstowcs(NULL,src,0)+1.
> >
> > We could add that.
>
> That might have enlightened me! I like the wording, and indeed, having
> it phrased the same way for these similar functions would be helpful.
I've applied a few patches to these pages:
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=06783b90b57459437eb4a91b127523cc61fb1173>
>
> > BTW, maybe you want to use mbstowcs(3), which is simpler.
>
> Indeed I should have chosen that.
>
> > I think we could add something saying that mbsrtowcs(3) is a
> > restartable version of mbstowcs(3).
>
> It might have helped me, and probably will help others.
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=b94a9c18d89c5c3a7a649c83e16de8034509c04e>
And a few more to be able to diff the pages with
$ diff -u <(man mbstowcs) <(man mbsrtowcs)
Which I had to use to understand the differences.
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=6f9e8feeb8d0c391b0e5eb3a2b4dc2d7eab4d098>
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=f77ff4a87d2ca676b81f6919676634ab126a18b2>
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=fcfa4c254f0454d34a9370e2051c84069183a46b>
Cheers,
Alex
>
> Thanks Alejandro!
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2023-11-14 10:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-13 13:48 [PATCH] mbsrtowcs.3: add a note for conversion completion Andriy Utkin
2023-11-14 9:21 ` Alejandro Colomar
2023-11-14 9:47 ` Andriy Utkin
2023-11-14 10:04 ` Alejandro Colomar [this message]
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=ZVNGPmVfB5EOgXdA@debian \
--to=alx@kernel.org \
--cc=andriy_utkin@fastmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.