From 2f2688b829cc61a453f668a3fa388489ad043528 Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 3 Jan 2005 22:07:40 +0000 Subject: (svn r1358) Assert bounds of depot list when searching for a depot --- ship_gui.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ship_gui.c') diff --git a/ship_gui.c b/ship_gui.c index 959cbd0ec..e90077aed 100644 --- a/ship_gui.c +++ b/ship_gui.c @@ -646,7 +646,9 @@ static void DrawShipDepotWindow(Window *w) 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); -- cgit v1.2.3-54-g00ecf