<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40260 >

Jason Dorje Short wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=40260 >
> 
> In S2_2/trunk:
> 
> savegame.c:2543: error: array subscript is above array bounds
> savegame.c:2543: error: array subscript is above array bounds

And the patch.

-jason

Index: server/savegame.c
===================================================================
--- server/savegame.c	(revision 14712)
+++ server/savegame.c	(working copy)
@@ -2533,6 +2533,8 @@
       struct city *pwork = tile_worked(pcenter);
 
       if (NULL != pwork) {
+	int cx, cy;
+
         freelog(LOG_ERROR, "player%d.c%d.workers"
                 " city center is worked by (%d,%d) \"%s\"[%d],"
                 " repairing (%d,%d) \"%s\"[%d]",
@@ -2540,7 +2542,8 @@
                 TILE_XY(city_tile(pwork)), city_name(pwork), pwork->size,
                 TILE_XY(pcenter), city_name(pcity), pcity->size);
 
-        pwork->city_map[x][y] = C_TILE_UNAVAILABLE;
+	city_base_to_city_map(&cx, &cy, pwork, pcity->tile);
+	pwork->city_map[cx][cy] = C_TILE_UNAVAILABLE;
         pwork->specialists[DEFAULT_SPECIALIST]++;
         auto_arrange_workers(pwork);
       } else {
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to