Subject: Re: is this a linux users' FUD spread?
To: None <pavel.cahyna@st.mff.cuni.cz,>
From: Andrew Reilly <andrew-netbsd@areilly.bpc-users.org>
List: current-users
Date: 07/07/2006 11:19:55
On Thu, Jul 06, 2006 at 11:45:13PM +0200, Pavel Cahyna wrote:
> On Thu, Jul 06, 2006 at 08:44:54PM +0000, Martijn van Buul wrote:
> > It came back. That code segment *does* seem kind of nasty, and does
> > seem to assume that "size_t" and "unsigned" have the same word length. 
> > However, I can't say it bears any resemblance to "our" code.
> 
> But look at fread.c .

What are we looking at in fread.c?  I see no unsigned there, and
the code all looks quite careful.

Hmm.  No, the range check on the size_t size argument to setvbuf()
is wrong: (int)size < 0, rather than size < INT_MAX, so
there's some possibility that a user-supplied buffer could be
incorrectly under-utilized on a system with 64-bit size_t...

I don't think that's an error in fread.c per se, though.

Cheers,

-- 
Andrew