[Freeciv-Dev] Crash in 7-27-2001 CVS GTK+ client (PR#869)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Full_Name: Kevin Brown
Version: CVS Jul-27-2001
Distribution: Built from source
Client: Gtk+
OS: Mandrake 6.1 (heavily modified), gcc 2.95.2
Submission from: (NULL) (24.11.140.23)
Moving the map with the scrollbars to the edge of the map will cause the client
to crash. The problem was that the derived 'x' value in get_drawn_char (as
called from get_drawn) would be out of bounds with respect to the map
dimensions. The following patch I developed appears to fix it. I believe the
patch is correct since the intention is to have the map "wrap around" in the x
direction but not the y direction.
Given the nature of the bug, I wouldn't be surprised if it manifests itself in
all versions of the client.
--- client/goto.c.goto Sat Jun 30 04:37:43 2001
+++ client/goto.c Sat Jul 28 21:16:40 2001
@@ -631,6 +631,9 @@
dir = 7 - dir;
}
+ if (x < 0) x += map.xsize;
+ if (x >= map.xsize) x -= map.xsize;
+
return goto_map.drawn[x] + y*4 + dir;
}
- [Freeciv-Dev] Crash in 7-27-2001 CVS GTK+ client (PR#869),
kevin <=
|
|