Issue in man page wcsncpy.3

Alejandro Colomar alx.manpages@gmail.com
Sun Dec 4 23:28:11 GMT 2022


Hi Sam,

On 12/5/22 00:09, Sam James wrote:
> 
> 
>> On 4 Dec 2022, at 23:06, Sam James via Libc-alpha <libc-alpha@sourceware.org> wrote:
>>
>>
>>
>>> On 4 Dec 2022, at 20:42, Alejandro Colomar via Libc-alpha <libc-alpha@sourceware.org> wrote:
>>>
>>> Hi Helge, glibc developers,
>>>
>>> On 12/4/22 10:07, Helge Kreutzmann wrote:
>>>> Without further ado, the following was found:
>>>> Issue:    Is the "L" in the bracket (for the NULL character) correct?
>>>> "The B<wcsncpy>()  function is the wide-character equivalent of the"
>>>> "B<strncpy>(3)  function.  It copies at most I<n> wide characters from the"
>>>> "wide-character string pointed to by I<src>, including the terminating null"
>>>> "wide character (L\\(aq\\e0\\(aq), to the array pointed to by I<dest>."
>>>> "Exactly I<n> wide characters are written at I<dest>.  If the length"
>>>> "I<wcslen(src)> is smaller than I<n>, the remaining wide characters in the"
>>>> "array pointed to by I<dest> are filled with null wide characters.  If the"
>>>> "length I<wcslen(src)> is greater than or equal to I<n>, the string pointed"
>>>> "to by I<dest> will not be terminated by a null wide character."
>>>
>>> As an unrelated note.  I've had this running in my mind for some time... your various bug reports for strncpy(3) and similar wide character functions have triggered those thougts.
>>>
>>> I'm going to mark strncpy(3) and similar functions as deprecated, even if no libc or standard has done so.  There's wide agreement (at least in some communities) that strncpy(3) _is evil_.  There's simply no use for it.
>>>
>>
>> Please don't do this unilaterally. Apple did this unilaterally for sprintf which has caused problems, as well.
> 
> snprintf, that is

No, they deprecated sprintf(3), AFAIK.
<https://lists.gnu.org/r/bug-gnulib/2022-11/msg00013.html>

Cheers,

Alex

-- 
<http://www.alejandro-colomar.es/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20221205/794c989e/attachment.sig>


More information about the Libc-alpha mailing list