summaryrefslogtreecommitdiff
path: root/src/town_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-01-10 18:56:51 +0000
committerrubidium <rubidium@openttd.org>2007-01-10 18:56:51 +0000
commitf35ed4bbc2b05f1b83476b60948d64375f77f1b4 (patch)
tree1a1c59c13ddb1d152052f3a3a0bcffe4fb531173 /src/town_gui.cpp
parenta332d10fd938f345fff18e5f4a662a58f692f734 (diff)
downloadopenttd-f35ed4bbc2b05f1b83476b60948d64375f77f1b4.tar.xz
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
Diffstat (limited to 'src/town_gui.cpp')
-rw-r--r--src/town_gui.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index f580cd324..56084b3b2 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -16,6 +16,7 @@
#include "player.h"
#include "network/network.h"
#include "variables.h"
+#include "helpers.hpp"
static const Widget _town_authority_widgets[] = {
{ WWT_CLOSEBOX, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
@@ -409,7 +410,7 @@ static void MakeSortedTownList(void)
uint n = 0;
/* Create array for sorting */
- _town_sort = realloc((void*)_town_sort, (GetMaxTownIndex() + 1) * sizeof(_town_sort[0]));
+ ReallocT(&_town_sort, GetMaxTownIndex() + 1);
if (_town_sort == NULL) error("Could not allocate memory for the town-sorting-list");
FOR_ALL_TOWNS(t) _town_sort[n++] = t;