#153508 XGammon failing with SIGFPE

Package:
xgammon
Source:
xgammon
Description:
Implementation of backgammon under X
Submitter:
Jeffrey Chimene
Date:
2005-07-18 03:10:26 UTC
Severity:
normal
#153508#5
Date:
2002-07-19 00:28:00 UTC
From:
To:
In disposition.c, remove the "=" from the loop termination expression:
bsh> diff -ed  ~/xgammon-0.98a.orig/decision.c decision.c
601c
    for (i=0; i<18;i++) other_array[i] /= sum;
.
588c
    for (i=0; i<18;i++) t_array[i] /= sum;
.

other_array[18] and t_array[18] shouldn't be referenced in the loops
abstracted above. The arrays are initialized from the endgame table in
an earlier loop from 0 to 17; which means the value at index 18 is
undefined. The program sets each array at index 18 to 0.0 before
proceeding to the winning chance calculation.