[comp.sources.bugs] Fix to BSD version of "chess"

danny@itm.UUCP (Danny) (05/29/87)

In adding the changes for BSD, Rich used
    "bzero((char *)a, sizeof a);"
BUT, the variable "a" is an array passed as an argument.  The sizeof (a)
is the sizeof (pointer to (typeof (a))), which on my machine is 4.

Around line 985 (your line numbers may differ) in the routine "ataks",
change the "bzero((char *)a, sizeof a);" to
           "bzero((char *)a, 64*sizeof(short));".

Recompile, and stand back.

Below appears the final version of the lines in question:

#ifdef  BSD
        bzero((char *)a, 64*sizeof (short));
#else
        a = (short *)memset(a,0,64*sizeof(short));
#endif  /* BSD */

                                                Danny
-- 
				Daniel S. Cox
				({seismo!gatech|ihnp4!akgua}!itm!danny)