summaryrefslogtreecommitdiffstats
path: root/battlestar/cypher.c
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>2000-09-24 09:41:53 +0000
committerjsm <jsm@NetBSD.org>2000-09-24 09:41:53 +0000
commit643584bcfcd68daf078c95da21cab1a3e3188155 (patch)
treea7b1d9bdedcba181e0ccfc0585850a5849bbf932 /battlestar/cypher.c
parentf55810a947cd7ac1e0a30fc324fd8dd7794aadf8 (diff)
downloadbsdgames-darwin-643584bcfcd68daf078c95da21cab1a3e3188155.tar.gz
bsdgames-darwin-643584bcfcd68daf078c95da21cab1a3e3188155.zip
Prevent CUMBER from going negative; avoid division by zero if it is
zero.
Diffstat (limited to 'battlestar/cypher.c')
-rw-r--r--battlestar/cypher.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/battlestar/cypher.c b/battlestar/cypher.c
index ef697edc..6fd3c7df 100644
--- a/battlestar/cypher.c
+++ b/battlestar/cypher.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cypher.c,v 1.17 2000/09/22 08:19:57 jsm Exp $ */
+/* $NetBSD: cypher.c,v 1.18 2000/09/24 09:41:53 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cypher.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: cypher.c,v 1.17 2000/09/22 08:19:57 jsm Exp $");
+__RCSID("$NetBSD: cypher.c,v 1.18 2000/09/24 09:41:53 jsm Exp $");
#endif
#endif /* not lint */
@@ -312,7 +312,8 @@ cypher()
if (testbit(inven, n))
printf("\t%s\n", objsht[n]);
printf("\n= %d kilogram%s (%d%%)\n", carrying, (carrying == 1 ? "." : "s."), (WEIGHT ? carrying * 100 / WEIGHT : -1));
- printf("Your arms are %d%% full.\n", encumber * 100 / CUMBER);
+ printf("Your arms are %d%% full.\n",
+ (CUMBER ? encumber * 100 / CUMBER : -1));
} else
puts("You aren't carrying anything.");