From 28e969924b9033f5132fe2ba223e2bcadd39a7ec Mon Sep 17 00:00:00 2001 From: KUDr Date: Thu, 11 Jan 2007 17:29:39 +0000 Subject: (svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter --- src/station_gui.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/station_gui.cpp') diff --git a/src/station_gui.cpp b/src/station_gui.cpp index c4f778e1a..94f6d6341 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -198,13 +198,12 @@ static void BuildStationsList(plstations_d* sl, PlayerID owner, byte facilities, { uint n = 0; uint i, j; - const Station** station_sort; const Station *st; if (!(sl->flags & SL_REBUILD)) return; /* Create array for sorting */ - MallocT(&station_sort, GetMaxStationIndex() + 1); + const Station** station_sort = MallocT(GetMaxStationIndex() + 1); if (station_sort == NULL) error("Could not allocate memory for the station-sorting-list"); DEBUG(misc, 3, "Building station list for player %d", owner); @@ -231,7 +230,7 @@ static void BuildStationsList(plstations_d* sl, PlayerID owner, byte facilities, } free((void*)sl->sort_list); - MallocT(&sl->sort_list, n); + sl->sort_list = MallocT(n); if (n != 0 && sl->sort_list == NULL) error("Could not allocate memory for the station-sorting-list"); sl->list_length = n; -- cgit v1.2.3-54-g00ecf