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/string.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/string.cpp')
-rw-r--r-- | src/string.cpp | 3 |
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; } |