Skip to main content.
home | support | download

Back to List Archive

Re: fhash.c bug?

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Mon Mar 28 2005 - 18:00:34 GMT
On Mon, Mar 28, 2005 at 09:36:07AM -0800, Peter Karman wrote:
> I traced the loop to uncompress1(), then googled for f_getc, which turned up (of 
> all things), the Swish-e archive.

f_getc is a parameter to the function.  It's not an int or char, but
an address of a function being passed in.  Which function depends on
how it's called.  Sometimes it's fgetc (man fgetc) and sometimes
it's sw_fetc.  As far as I know they are the same thing -- but I
think Jose probably thought that there might be a time when they are
different so allowed for that.

> I followed the advice Bill and Patrick suggested and inserted this:
> 
>      do
>      {
>          _c = (int) f_getc(fp);
> 
> 
>     /* FIX */
>          if (_c < 0) {
>               progerr("\nfatal err: _c is < 0 in uncompress1\n");
>          }

Because it means something is happening that wasn't dealt with
correctly in the code.  Clearly, input data while indexing shouldn't
cause this.

Next two days are not good for me.  Maybe Jose will be able to help
(I'm not sure if he's reading the list or not).  But at least there's
a method to reproduce it.

-- 
Bill Moseley
moseley@hank.org

Unsubscribe from or help with the swish-e list: 
   http://swish-e.org/Discussion/

Help with Swish-e:
   http://swish-e.org/current/docs
   swish-e@sunsite.berkeley.edu
Received on Mon Mar 28 10:00:36 2005