From 9218fc16e6fff350e6209b6b90b8597fc431f00f Mon Sep 17 00:00:00 2001 From: matthijs Date: Tue, 5 Dec 2006 13:58:20 +0000 Subject: (svn r7372) - CodeChange: Rename all GetXXXArraySize() functions to GetNumXXX() and add GetMaxXXXIndex() functions. This prepares for the new pool interface. --- town_gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'town_gui.c') diff --git a/town_gui.c b/town_gui.c index 03f87edad..1434edcdd 100644 --- a/town_gui.c +++ b/town_gui.c @@ -409,7 +409,7 @@ static void MakeSortedTownList(void) uint n = 0; /* Create array for sorting */ - _town_sort = realloc((void*)_town_sort, GetTownArraySize() * sizeof(_town_sort[0])); + _town_sort = realloc((void*)_town_sort, (GetMaxTownIndex() + 1) * sizeof(_town_sort[0])); if (_town_sort == NULL) error("Could not allocate memory for the town-sorting-list"); -- cgit v1.2.3-54-g00ecf