summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>1999-12-29 00:46:46 +0000
committerWarner Losh <imp@FreeBSD.org>1999-12-29 00:46:46 +0000
commit7c74ea6870809f789b2e7f4fa0cf32c9f2a4334c (patch)
tree3a5049bf572bc25025a751d5fb4cc625c0386380 /games
parentFix a crash on -STABLE with a SIGFPE error which would happen every few (diff)
Don't divide by zero when starting with no wins/losses.
PR: 14176
Notes
Notes: svn path=/head/; revision=24212
Diffstat (limited to 'games')
-rw-r--r--games/seahaven/files/patch-aa16
1 files changed, 16 insertions, 0 deletions
diff --git a/games/seahaven/files/patch-aa b/games/seahaven/files/patch-aa
new file mode 100644
index 000000000000..fc3953758977
--- /dev/null
+++ b/games/seahaven/files/patch-aa
@@ -0,0 +1,16 @@
+--- score.C.org Tue Dec 28 17:35:27 1999
++++ score.C Tue Dec 28 17:37:37 1999
+@@ -82,8 +82,12 @@
+ printLine("%5d game%s played", wins + losses);
+ curx = GAMEWIDTH / 4;
+ cury = 0;
+- printLine("Winning average: %5.2f%%", 100.0 *
++ if (wins + losses) {
++ printLine("Winning average: %5.2f%%", 100.0 *
+ ((double) wins / (double) (wins + losses)));
++ } else {
++ printLine("Winning Average: N/A", 0, "");
++ }
+ curx = GAMEWIDTH / 2;
+ cury = 0;
+ if (streak > 0) {