summaryrefslogtreecommitdiffstats
path: root/games/seahaven
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1999-12-29 00:46:46 +0000
committerimp <imp@FreeBSD.org>1999-12-29 00:46:46 +0000
commitb25e8a33fea8c9176d0f76e81ad1d0178335ba87 (patch)
tree823d14cc58fcba7164997ae0738659322246f086 /games/seahaven
parentc9324a8925046e6283ced26a985f5ab1d39f7102 (diff)
downloadFreeBSD-ports-b25e8a33fea8c9176d0f76e81ad1d0178335ba87.zip
FreeBSD-ports-b25e8a33fea8c9176d0f76e81ad1d0178335ba87.tar.gz
Don't divide by zero when starting with no wins/losses.
PR: 14176
Diffstat (limited to 'games/seahaven')
-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 0000000..fc39537
--- /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) {
OpenPOWER on IntegriCloud