[net.micro.mac] new version of xbin -- fix for checksum bug

ddj@brunix.UUCP (Dave Johnson) (10/01/85)

After an hour or two of bug-chasing, I tracked down the cause of
the recently reported checksum errors in "xbin".

The problem showed up when there was a run of three or more 0x90
characters.  The sequence 0x90NN indicates that the previous
character should be repeated NN times, with the exception that
0x9000 specifies a literal 0x90.  The bug was when a literal 0x90
was supposed to be repeated, the character before the 0x90 was
used instead.  So where 2090009003 should have produced a 20 and
3- 90's, it came out 20 90 20 20.

Here is the fix to version 2.1, if you can't get 2.3 right away:
*** xbin.c	Tue Oct  1 01:16:20 1985
--- xbin.c.fixed	Tue Oct  1 01:17:21 1985
***************
*** 545,550
  		if ((rep = getq_raw()) == EOF)
  			return EOF;
  		if (rep == 0) {
  			return RUNCHAR;
  		}
  		else {

--- 545,551 -----
  		if ((rep = getq_raw()) == EOF)
  			return EOF;
  		if (rep == 0) {
+ 			lastc = RUNCHAR;
  			return RUNCHAR;
  		}
  		else {

Source for version 2.3 (there was no 2.2) is in net.sources.mac
and should be archived on [sumex]<info-mac>unix-xbin.shar. 

In addition to the above-described bug fix, this version includes
fixes people have sent me during the last 6 months or so, and the
performance improvements done by Dan LaLiberte at UIUC (sorry for
the delay...).

	Dave Johnson
	Brown University Computer Science
	ddj%brown@csnet-relay.ARPA
	{ihnp4,decvax,allegra,ulysses,linus}!brunix!ddj