diff options
author | KUDr <kudr@openttd.org> | 2007-01-11 17:29:39 +0000 |
---|---|---|
committer | KUDr <kudr@openttd.org> | 2007-01-11 17:29:39 +0000 |
commit | 33be1ecfb1a9056b027d50d7b558cff87c5b744d (patch) | |
tree | d644a3831ca0947198b191fa3e4e8973d3a9786e /src/newgrf_text.cpp | |
parent | 91ff74641060445dc1647bbf05baeb03b45c3099 (diff) | |
download | openttd-33be1ecfb1a9056b027d50d7b558cff87c5b744d.tar.xz |
(svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter
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; } |