Thread (7 messages) 7 messages, 2 authors, 2025-07-11

Re: [PATCH] wcpncpy.3: fix incorrect return value.

From: Alejandro Colomar <alx@kernel.org>
Date: 2025-07-11 13:37:57

Hi Elliott,

On Thu, Jul 03, 2025 at 12:12:49AM +0200, Alejandro Colomar wrote:
On Wed, Jul 02, 2025 at 04:40:31PM -0400, enh wrote:
quoted
quoted
Hmmm, yup, that's quite incorrect.
We should add this to the commit message:

        Fixes: d91506f8faa4 (1999-08-24, 2022-12-19; "man-pages 1.26")
quoted
+returns a pointer to the end of the wide-character string
+.IR dest ,
I don't like this wording.  It gives the impression that this function
is appropriate to create wide strings, while it's not.
i actually didn't come up with that: i looked to see what wcsncpy()
said and copied that :-)
Hmmm, I should rewrite wcsncpy(3) then.  (And st[rp]ncpy(3) maybe too.)  :-)
I didn't find any text in wcsncpy(3) similar to this.  Maybe you read it
elsewhere?  It would be interesting to find the source, if it needs to
be fixed.

[...]
quoted
quoted
How about this:

        returns a pointer to
        one past the last non-null wide character written,
        that is,
        .IR dest\~+\~wcsnlen(src,\~n).
yeah, that's a good way to avoid having to describe both cases
separately
Thanks!  I'll use that.
I've applied these two commits:

<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=53783e73e482042cff0db76762d808b2f73305a1>
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=7e4e9222e90d11ee0f7ad35004eb00c3d56b3574>


Have a lovely day!
Alex

-- 
<https://www.alejandro-colomar.es/>

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help