[comp.sys.isis] Bug in sun_grid version of grid demo

ken@gvax.cs.cornell.edu (Ken Birman) (10/05/89)

If you use the suntools version of the grid demo (sun_grid)
you should make the following patch:

demos/sun_grid.c:
459c459
<       sprintf(string, "%d", value[i][j]);
---
>       sprintf(string, "%.2d", value[i][j]);	/* new */

The problem that this corrects is quite stupid.  When running
the program, if a number has a 2-digit representation (say, 16)
the displayed value occupies 2 character positions.  If the  program
next decides to divide it by 2 (getting 8), it only overwrites
the first digit (showing 86).  This sticks out as an apparent
"isis bug" if you manage to add a new member to the group and stop
the display when such an erroneous value is displayed.  The grid should
show identical values, but the new process will show the correct one (8)
while the old ones continue to show this incorrect superimposition.

In the X versions of "grid" this problem won't occur; Robert
carefully wipes the screen clear before printing new characters.
(He wrote the X version; guess who wrote the suntools one?)