diff options
Diffstat (limited to 'src/newgrf_text.cpp')
-rw-r--r-- | src/newgrf_text.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index af1dc688a..021defb9c 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -158,8 +158,7 @@ static byte _currentLangID = GRFLX_ENGLISH; //by default, english is used. char *TranslateTTDPatchCodes(const char *str) { - char *tmp; - MallocT(&tmp, strlen(str) * 10 + 1); /* Allocate space to allow for expansion */ + char *tmp = MallocT<char>(strlen(str) * 10 + 1); /* Allocate space to allow for expansion */ char *d = tmp; bool unicode = false; WChar c; @@ -255,7 +254,7 @@ char *TranslateTTDPatchCodes(const char *str) } *d = '\0'; - ReallocT(&tmp, strlen(tmp) + 1); + tmp = ReallocT(tmp, strlen(tmp) + 1); return tmp; } |