Subject: bin/6049: [PATCH] Battlestar bug fix 4
To: None <gnats-bugs@gnats.netbsd.org>
From: Joseph Myers <jsm@octomino.demon.co.uk>
List: netbsd-bugs
Date: 08/26/1998 15:51:49
>Number:         6049
>Category:       bin
>Synopsis:       [PATCH] Battlestar bug fix 4
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 26 11:20:00 1998
>Last-Modified:
>Originator:     Joseph Samuel Myers
>Organization:
Trinity College, University of Cambridge, UK
>Release:        NetBSD-current of 1998-08-24
>Environment:
[
System: Linux octomino 2.0.35 #1 Wed Aug 12 15:54:21 UTC 1998 i586 unknown
Architecture: i586
]
>Description:

The appended patch to the game battlestar adds a check for the case of
not specifying something to give (e.g., command `give' by itself).

>How-To-Repeat:

>Fix:

diff -ruN battlestar/com5.c battlestar+1/com5.c
--- battlestar/com5.c	Sat Oct 11 11:50:11 1997
+++ battlestar+1/com5.c	Wed Aug 26 11:32:44 1998
@@ -259,6 +259,10 @@
 		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))

>Audit-Trail:
>Unformatted: