Bug in compress
willcox at ccvaxa.UUCP
willcox at ccvaxa.UUCP
Sat Jan 12 02:57:00 AEST 1985
I hope that this is the right place to report bugs from mod.sources.
Thanks for "compress". It is impressive. I wonder how many of the
floppies for my micro I can free up.
I did run into one bug that shows up when you try to run compress on a
machine that correctly implements comparison between signed and
unsigned ints. The following code appears in two places in
compress.c:
while ( (c = getchar()) != (unsigned) EOF ) {
The problem is that ((unsigned) -1) is not the same thing as ((int) -1).
The vax (and many other machines) do 32-bit compares, and say they are
equal, but other machines (correctly) do not. The program drops into
an infinite loop looking for EOF.
The "(unsigned)" in the above expression should be removed. It won't
break the program on machines that do the compare wrong, and will make
it work on machines that do it right.
With this change, compress works on the Gould machines.
David A. Willcox
Gould CSD, North
Urbana, IL 61801
(217) 384-8500
{ihnp4,decvax}!uiucdcs!ccvaxa
More information about the Comp.sources.bugs
mailing list