This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: unbuffered fread() problem


Thanks for catching this Jason. Patch checked in.

-- Jeff J.

Jason Tishler wrote:
While running the Cygwin Python 2.4b1 regression test, I uncovered a
newlib unbuffered fread() problem.  The first attachment, ut.cc, is a
test case that demonstrates the issue:

    $ echo -n 0 >/tmp/foo
    ut /tmp/foo 1
    count = 1023
    buffer = (0$)

Hence, one can see that fread() in unbuffered mode always returns the
specified count instead of the number of elements actually read.

The second attachment is a "patch" that "fixes" the problem.  I'm using
the words "patch" and "fixes" loosely because although the problem is
corrected, this may not be the best approach.  Since I'm not that
familiar with newlib, I'm also concerned this patch may even cause other
unforeseen problems.  Anyway, the patch should at least point one more
familiar with newlib to the specific part of the code that needs rework.

Thanks,
Jason



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]