[net.micro.mac] bug in UW server

jdb@mordor.UUCP (John Bruner) (03/19/86)

In recent private correspondence, Mike Meyer pointed out a bug in
the UW server.  When I looked into it, I discovered another (even
more embarrassing) bug.

Both of the bugs are in the routine "mxmit()".  The declaration:

	register char *cp, *cq, i;
	register int len;

should be changed to

	register char *cp, *cq;
	register int i, len;

"i" must be an "int" because it is set to (and tested for) the value
-1.  (I am amazed that this worked.)

Further down there is some code:

	if (*cp == RUB || *cp < ' ') {
		i = sizeof ctlch;

This should be

	if (*cp == RUB || *cp < ' ') {
		i = sizeof ctlch / sizeof ctlch[0] - 1;

since "ctlch" is an array of "int" and the loop is supposed to run
backwards from the last to the first element of that array.

Many thanks to Mike for finding this.
-- 
  John Bruner (S-1 Project, Lawrence Livermore National Laboratory)
  MILNET: jdb@mordor [jdb@s1-c.ARPA]	(415) 422-0758
  UUCP: ...!ucbvax!dual!mordor!jdb 	...!seismo!mordor!jdb