input.c: nextLine EOF bug + patch
29 Jul
2002
29 Jul
'02
2:57 p.m.
Moin, I've just stumbled across a bug in Hugs98 Dec2001 on my PowerPC running Debian GNU/Linux. The bug is in src/input.c, line 516: arctic:~/build/deb/hugs98-98.200112/src% make input.o gcc -c -g -O2 input.c input.c: In function `nextLine': input.c:516: warning: comparison is always false due to limited range of data type arctic:~/build/deb/hugs98-98.200112/src% gcc --version 2.95.4 The comparison in question is the check for EOF, which is #defined as -1 in my stdio.h. This sent my Hugs into an infinite loop when loading the Prelude. The attached patch fixes the problem by storing the result of fgetc() in an int and using that for the comparison with EOF. Happy hacking, Sven Moritz
8747
Age (days ago)
8747
Last active (days ago)
0 comments
1 participants
participants (1)
-
Sven M. Hallberg