Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] string.c: prefer memcpy() over strcpy()



On Sat, Dec 30, 2023 at 9:44 PM James Tirta Halim
<tirtajames45@xxxxxxxxx> wrote:
>
> Add STRCPY_WLEN, a memcpy() that nul-terminates.

This may be a worthwhile optimization given how frequently
dupstring/ztrdup/dyncat are used, but I'm concerned that "WLEN" may be
confused with counts of wide characters.

STRNCPY_NUL() or even ZSTRNCPY() ?

Also in the last hunk the size_t locals are not made const as they are
in the other hunks, if we're moving in that direction we might as well
be consistent.




Messages sorted by: Reverse Date, Date, Thread, Author