summaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorKUDr <KUDr@openttd.org>2007-01-11 17:29:39 +0000
committerKUDr <KUDr@openttd.org>2007-01-11 17:29:39 +0000
commit28e969924b9033f5132fe2ba223e2bcadd39a7ec (patch)
treed644a3831ca0947198b191fa3e4e8973d3a9786e /src/string.cpp
parent5675956443d4e58713a0abd8cedb4eaaaccf22d4 (diff)
downloadopenttd-28e969924b9033f5132fe2ba223e2bcadd39a7ec.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/string.cpp')
-rw-r--r--src/string.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/string.cpp b/src/string.cpp
index 7e4aaf1d2..4556ac64b 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -59,12 +59,11 @@ char* CDECL str_fmt(const char* str, ...)
char buf[4096];
va_list va;
int len;
- char* p;
va_start(va, str);
len = vsnprintf(buf, lengthof(buf), str, va);
va_end(va);
- MallocT(&p, len + 1);
+ char* p = MallocT<char>(len + 1);
if (p != NULL) memcpy(p, buf, len + 1);
return p;
}