fgetc-usage causing infinite-loop on linux-ppc

Philipp Schmidt <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.bugs
Message-ID <[email protected]>
The usage of fgetc, reading fgetc into an unsigned char causing an
infinite loop because eof iss too large for an unsigned char

the following patch solves the problem:

diff -r hugs98-Dec2001/src/input.c hugs98-Dec2001.fixed/src/input.c
515,516c515,517
<         lineBuffer[lineLength] = fgetc(inputStream);
<         if (lineBuffer[lineLength] == EOF)
---
>       int c = fgetc(inputStream);
>         lineBuffer[lineLength] = c;
>         if (c == EOF)

AVE!
  phils...

-- 
     PHILIPP SCHMIDT / phils - - + - - > [email protected]
     Phone: +49(179)6737439      ` - - > http://home.pages.de/~phils/
     wenn w eine   aube ist dn      man au dran dre en 
          o     Schr        an muss     hc         h   (Kurt Schwitters)
:wq
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.