Page 1 of 1

ps2lib bug fioGets

Posted: Wed Apr 14, 2004 4:37 am
by denver
The next code avalaible at ps2lib 2.1:

Code: Select all

case '\n':
         fioLseek(fd, i-read, SEEK_CUR);
         i++;
         buff[i]=0;	// terminate after newline
         return i;
         .............
should be:

Code: Select all

case '\n':
         fioLseek(fd, (i+1)-read, SEEK_CUR);
         buff[i]=0;
         return i;
         ..............
where the main change is that fioLseek doesn't read again the character \n and thus the function does not remain reading eternally :roll:

Posted: Wed Apr 14, 2004 5:33 am
by mrbrown
Fixed, thanks!