Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#10144) helpdata genlist bug
Home

[Freeciv-Dev] (PR#10144) helpdata genlist bug

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10144) helpdata genlist bug
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 16 Sep 2004 02:04:03 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10144 >

The helpdata code uses its own genlist iterators.  This is obviously 
bad; see PR#9640.  In this case it causes a crash.

jason

? drawn_sprites.diff
? ftwl.diff
? settler_recursion_crash
? client/tilespec.diff
Index: client/helpdata.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/helpdata.c,v
retrieving revision 1.79
diff -u -r1.79 helpdata.c
--- client/helpdata.c   14 Sep 2004 17:03:46 -0000      1.79
+++ client/helpdata.c   16 Sep 2004 09:01:49 -0000
@@ -466,8 +466,10 @@
   const struct help_item *pitem;
   
   check_help_nodes_init();
-  pitem = help_nodes_iterator->dataptr;
-  help_nodes_iterator = help_nodes_iterator->next;
+  pitem = ITERATOR_PTR(help_nodes_iterator);
+  if (pitem) {
+    ITERATOR_NEXT(help_nodes_iterator);
+  }
 
   return pitem;
 }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10144) helpdata genlist bug, Jason Short <=