Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles $Revision: 1.6.2.17 $; site ccvaxa.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!inuxc!pur-ee!uiucdcs!ccvaxa!willcox From: willcox@ccvaxa.UUCP Newsgroups: net.sources.bugs Subject: Bug in compress Message-ID: <53800002@ccvaxa.UUCP> Date: Fri, 11-Jan-85 11:57:00 EST Article-I.D.: ccvaxa.53800002 Posted: Fri Jan 11 11:57:00 1985 Date-Received: Mon, 14-Jan-85 01:36:49 EST Lines: 29 Nf-ID: #N:ccvaxa:53800002:000:1017 Nf-From: ccvaxa!willcox Jan 11 10:57:00 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