--- a/roadveh_gui.c Mon Jan 03 22:04:34 2005 +0000
+++ b/roadveh_gui.c Mon Jan 03 22:07:40 2005 +0000
@@ -512,7 +512,9 @@
SetVScrollCount(w, (num + w->hscroll.cap - 1) / w->hscroll.cap);
/* locate the depot struct */
- for(d=_depots; d->xy != (TileIndex)tile; d++) {}
+ for (d = _depots; d->xy != (TileIndex)tile; d++) {
+ assert(d < endof(_depots);
+ }
SetDParam(0, d->town_index);
DrawWindowWidgets(w);
--- a/ship_gui.c Mon Jan 03 22:04:34 2005 +0000
+++ b/ship_gui.c Mon Jan 03 22:07:40 2005 +0000
@@ -646,7 +646,9 @@
SetVScrollCount(w, (num + w->hscroll.cap - 1) / w->hscroll.cap);
/* locate the depot struct */
- for(d=_depots; d->xy != (TileIndex)tile; d++) {}
+ for (d = _depots; d->xy != (TileIndex)tile; d++) {
+ assert(d < endof(_depots);
+ }
SetDParam(0, d->town_index);
DrawWindowWidgets(w);
--- a/train_gui.c Mon Jan 03 22:04:34 2005 +0000
+++ b/train_gui.c Mon Jan 03 22:07:40 2005 +0000
@@ -333,7 +333,9 @@
SetHScrollCount(w, hnum);
/* locate the depot struct */
- for(d=_depots; d->xy != (TileIndex)tile; d++) {}
+ for (d = _depots; d->xy != (TileIndex)tile; d++) {
+ assert(d < endof(_depots);
+ }
SetDParam(0, d->town_index);
DrawWindowWidgets(w);