diff options
Diffstat (limited to 'src/fios.cpp')
-rw-r--r-- | src/fios.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/fios.cpp b/src/fios.cpp index 950e26a23..87e7ea93d 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -11,6 +11,7 @@ #include "variables.h" #include "functions.h" #include "heightmap.h" +#include "helpers.hpp" #include "table/strings.h" #include "fios.h" #include <sys/types.h> @@ -47,7 +48,7 @@ FiosItem *FiosAlloc(void) { if (_fios_count == _fios_alloc) { _fios_alloc += 256; - _fios_items = realloc(_fios_items, _fios_alloc * sizeof(FiosItem)); + ReallocT(&_fios_items, _fios_alloc); } return &_fios_items[_fios_count++]; } @@ -323,7 +324,7 @@ FiosItem *FiosGetSavegameList(int mode) static char *_fios_save_path = NULL; if (_fios_save_path == NULL) { - _fios_save_path = malloc(MAX_PATH); + MallocT(&_fios_save_path, MAX_PATH); ttd_strlcpy(_fios_save_path, _paths.save_dir, MAX_PATH); } @@ -371,7 +372,7 @@ FiosItem *FiosGetScenarioList(int mode) static char *_fios_scn_path = NULL; if (_fios_scn_path == NULL) { - _fios_scn_path = malloc(MAX_PATH); + MallocT(&_fios_scn_path, MAX_PATH); ttd_strlcpy(_fios_scn_path, _paths.scenario_dir, MAX_PATH); } @@ -402,7 +403,7 @@ FiosItem *FiosGetHeightmapList(int mode) static char *_fios_hmap_path = NULL; if (_fios_hmap_path == NULL) { - _fios_hmap_path = malloc(MAX_PATH); + MallocT(&_fios_hmap_path, MAX_PATH); strcpy(_fios_hmap_path, _paths.heightmap_dir); } |