This is the mail archive of the
xconq7@sourceware.cygnus.com
mailing list for the Xconq project.
Can't give a town its independence
- To: xconq7 at sourceware dot cygnus dot com
- Subject: Can't give a town its independence
- From: Jim Kingdon <kingdon at panix dot com>
- Date: Fri, 28 Apr 2000 14:07:20 -0400 (EDT)
Without the enclosed fix (running xconq from CVS), "G" enter (to give
a town its independence) causes a core dump. It would also be
possible to fix this in prep_change_side_action or elsewhere; I didn't
see much in the way of comments regarding how indepside should be
treated (see for example case 'S' in execute_action which turns NULL
into indepside). Establishing a consistent convention would probably
avoid a variety of bugs of this sort.
Actually, the right fix is probably somewhere near where the user
enters the name of the side. Right now any side name (such as
"argentinians") seems to get parsed as NULL. Numbers work OK.
Index: side.c
===================================================================
RCS file: /cvs/xconq/xconq/kernel/side.c,v
retrieving revision 1.20
diff -u -r1.20 side.c
--- side.c 2000/04/24 13:04:09 1.20
+++ side.c 2000/04/28 17:43:03
@@ -458,7 +458,8 @@
int
side_number(Side *side)
{
- return side->id;
+ /* NULL is used in various parts of the code to indicate the indepside. */
+ return side == NULL ? 0 : side->id;
}
/* The inverse function - given a number, figure out which side it is.