bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about gawk unofficial patch


From: Aharon Robbins
Subject: Re: Question about gawk unofficial patch
Date: Wed, 9 Feb 2005 14:05:25 +0200

Now fixed.  Sorry I didn't see what you were talking about
the first time.  Thanks for reporting this.

Arnold

> Date: Wed, 09 Feb 2005 17:31:11 +0900
> From: =?ISO-2022-JP?B?GyRCTFpCPDlAMGwbKEI=?= <address@hidden>
> Subject: Re: Question about gawk unofficial patch
> To: Aharon Robbins <address@hidden>
> Cc: address@hidden
>
> Hi,
>
> On Wed, 9 Feb 2005 09:27:18 +0200
> Aharon Robbins <address@hidden> wrote:
>
> > > malloced memory sizeof(wchar_t) * (r->wstlen + 2) bytes,
> > > but just only copied r->wstlen bytes. I guess this is not enough.
> > 
> > We need r->wstlen + 1 elements, note the assigment of a L'\0'
> > after the memcpy.  The + 2 provides a little extra breathing room;
> > it's been a convention in gawk for ages, before I took over full
> > time maintanance even.  I've decided to continue using this convention
> > even though in theory it's enough to just use length + 1 everywhere.
>
> In my understanding, wstlen holds number of elements not bytes.
> and memcpy copy data by byte counts. So, That memcpy have to copy
> sizeof(wchar_t) * r->wstlen *bytes*, I guess.
>
> -- 
> Kimura Koichi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]