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

Re: PATCH: Fix multibyte memory allocation in `wcs_ztrdup()'



Peter Stephenson wrote:
> On Mon, 28 Feb 2011 11:35:00 +0100
> Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
>> This was spotted by Thorsten Glaser from the mirbsd project.
>> 
>> `zalloc()' uses malloc(3) to allocate memory. wcslen(3) returns the
>> number of multibyte *characters* in a given string (N). The
>> destination string will have to be able to store N+1 wchar_ts, not
>> N+1 bytes.
>
> Thanks... and it needs to be a wide NULL (L'0'), too, so another
> lot of parentheses is needed.

Good point. :)



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