(svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter

This commit is contained in:
KUDr
2007-01-11 17:29:39 +00:00
parent 5675956443
commit 28e969924b
49 changed files with 141 additions and 181 deletions

View File

@@ -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;
}