Re: strncpy clarify result may not be null terminated

Stefan Puiu
2023-11-10T17:48:19Z

Hi Alex,

On Wed, Nov 8, 2023 at 9:33 PM Alejandro Colomar <alx@kernel.org> wrote:
[.....]
> strncpy(3):
> CAVEATS
> The name of these functions is confusing. These functions produce a
> null‐padded character sequence, not a string (see string_copying(7)).

I'm a bit confused by this distinction. Isn't a null-padded sequence
technically also null-terminated? If there's a '0' at the end, then
it's a string, in my understanding. Or was the intention to say "a
character sequence that may be null-padded", where the case in which
there's no padding at all being the reason for the distinction?

Thanks,
Stefan.