Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] string.c: prefer memcpy() over strcpy()
- X-seq: zsh-workers 52452
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: James Tirta Halim <tirtajames45@xxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] string.c: prefer memcpy() over strcpy()
- Date: Mon, 1 Jan 2024 16:23:59 -0800
- Archived-at: <https://zsh.org/workers/52452>
- In-reply-to: <20231231054304.48689-1-tirtajames45@gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <20231231054304.48689-1-tirtajames45@gmail.com>
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