zsh-workers
 help / color / mirror / code / Atom feed
From: Frank Terbeck <ft@bewatermyfriend.org>
To: <zsh-workers@zsh.org>
Subject: Re: PATCH: Fix multibyte memory allocation in `wcs_ztrdup()'
Date: Mon, 28 Feb 2011 13:04:04 +0100	[thread overview]
Message-ID: <87mxlgcqmj.fsf@ft.bewatermyfriend.org> (raw)
In-Reply-To: <20110228115510.29590f1d@pwslap01u.europe.root.pri> (Peter Stephenson's message of "Mon, 28 Feb 2011 11:55:10 +0000")

Peter Stephenson wrote:
> On Mon, 28 Feb 2011 11:35:00 +0100
> Frank Terbeck <ft@bewatermyfriend.org> 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. :)


      reply	other threads:[~2011-02-28 12:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-28 10:35 Frank Terbeck
2011-02-28 11:55 ` Peter Stephenson
2011-02-28 12:04   ` Frank Terbeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxlgcqmj.fsf@ft.bewatermyfriend.org \
    --to=ft@bewatermyfriend.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).