This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [COMMITTED] Fix off-by-one bug in tst-fwrite-error
- From: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Siddhesh Poyarekar <siddhesh at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 15 Apr 2013 13:08:57 +0530
- Subject: Re: [COMMITTED] Fix off-by-one bug in tst-fwrite-error
- References: <20130415060928 dot GJ9444 at spoyarek dot pnq dot redhat dot com> <mvmfvysw8xp dot fsf at hawking dot suse dot de>
On 15 April 2013 12:56, Andreas Schwab <schwab@suse.de> wrote:
>> I fixed this as obvious.
>
> I don't see anything that needs to change.
>
Earlier buf was defined as:
char buf[5] = "world";
which is wrong since "world" needs 6 characters including the NUL terminaor.
Changing it to:
char buf[] = "world";
resulted in the compiler giving buf size of 6 instead of 5, to
accommodate for the NUL.
Siddhesh
--
http://siddhesh.in