[ECOS] ZLIB and gzip - Bug in fread()

Stephen Polkowski stephen@centtech.com
Tue May 14 12:24:00 GMT 2002


Jesper,

	The first bug that I've found is in the fread() library call.  fread 
isn't updating it's buffer pointer for multiple reads. Notice that the 
read is done with ptr, but only ptrc is incremented.  The call should be 
made with ptrc. When I make the change, gzip starts working.

	Should I submit a patch?  What is the process of submitting patches. 
Thanks.

Regards,

Steve

/ecos/packages/language/c/libc/stdio/current/src/input/fread.cxx

     while (!err && bytes_to_read) { // if no err, but not finished
         err = real_stream->refill_read_buffer();
         if ( !err ) {
             err = real_stream->read( (cyg_uint8 *)ptr, bytes_to_read,
                                      &bytes_read );
             bytes_to_read -= bytes_read;
             total_read += bytes_read;
             ptrc += bytes_read;
         } // if
     } // while





Jesper Skov wrote:

> On Thu, 2002-05-09 at 00:04, Stephen Polkowski wrote:
> 
>>Hi,
>>
>>	I noticed that the gzip functions (gzio.c) weren't include in the zlib 
>>cdl.  Was this a mistake or was it left out on purpose?  Could we add a 
>>gzip option for zlib?  Thanks.
>>
> 
> It was left out only because it wasn't needed for the RedBoot zlib
> support. If ou need it, it's trivial to add. I don't know if it would
> Just Work(tm) though. You'd have to try it out.
> 
> Please post a message with any problems you may find (or if it Just
> Works) so we can add it in the repository.
> 
> Jesper
> 
> 
> 


-- 
Stephen Polkowski
Centaur Technology
Austin, TX
(512) 418-5730


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list