This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v4] [BZ #12836] Make fmemopen(buf,size,"w+b") binary.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, libc-alpha at sourceware dot org
- Date: Sat, 1 Jun 2013 14:59:17 +0200
- Subject: Re: [PATCH v4] [BZ #12836] Make fmemopen(buf,size,"w+b") binary.
- References: <20130509161648 dot GA31713 at domone dot kolej dot mff dot cuni dot cz> <Pine dot LNX dot 4 dot 64 dot 1305091636200 dot 25142 at digraph dot polyomino dot org dot uk> <20130514115947 dot GA7284 at domone dot kolej dot mff dot cuni dot cz> <20130520082527 dot GB32195 at domone dot kolej dot mff dot cuni dot cz> <20130523190913 dot 04DBA2C09E at topped-with-meat dot com> <20130524091603 dot GA10400 at domone dot kolej dot mff dot cuni dot cz> <20130529223249 dot 84F612C07E at topped-with-meat dot com>
On Wed, May 29, 2013 at 03:32:49PM -0700, Roland McGrath wrote:
> > Added comments except
> >
> > On Thu, May 23, 2013 at 12:09:12PM -0700, Roland McGrath wrote:
> > > > + for (i = 0 ; i < strlen (s) ; i++)
> > >
> > > Use sizeof. No spaces before ;.
> > Here strlen is rigth in case that in future tests s contains 0.
>
> What "future tests"? This is the program. It does what it does.
> If later you change it to do something different, then change it.
>
On closer look sizeof here is off by one error.