summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhubertf <hubertf@NetBSD.org>1998-08-28 00:44:31 +0000
committerhubertf <hubertf@NetBSD.org>1998-08-28 00:44:31 +0000
commit6a91faf8dfb7ce42973a6f5345bb74e37c8ae4ba (patch)
tree7bcdec2eafb2890f3417d07f6160ab586921a151
parentbef8f7c3aec4ed6171f8556971ab2db22014529f (diff)
downloadbsdgames-darwin-6a91faf8dfb7ce42973a6f5345bb74e37c8ae4ba.tar.gz
bsdgames-darwin-6a91faf8dfb7ce42973a6f5345bb74e37c8ae4ba.zip
Don't allow empty "give" command (without arguments).
Fixes PR 6049 by Joseph Myers <jsm@octomino.demon.co.uk>.
-rw-r--r--battlestar/com5.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/battlestar/com5.c b/battlestar/com5.c
index 115f50f7..57da3aa6 100644
--- a/battlestar/com5.c
+++ b/battlestar/com5.c
@@ -1,4 +1,4 @@
-/* $NetBSD: com5.c,v 1.6 1997/10/11 02:07:06 lukem Exp $ */
+/* $NetBSD: com5.c,v 1.7 1998/08/28 00:44:31 hubertf Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)com5.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: com5.c,v 1.6 1997/10/11 02:07:06 lukem Exp $");
+__RCSID("$NetBSD: com5.c,v 1.7 1998/08/28 00:44:31 hubertf Exp $");
#endif
#endif /* not lint */
@@ -259,6 +259,10 @@ give()
person = wordvalue[wordnumber];
last2 = wordnumber;
}
+ if (last1 == 0) {
+ puts("You didn't say what to give.");
+ return (0);
+ }
wordnumber = last1 - 1;
if (person && testbit(location[position].objects, person))
if (person == NORMGOD && godready < 2 && !(obj == RING || obj == BRACELET))