summaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-01-10 18:56:51 +0000
committerrubidium <rubidium@openttd.org>2007-01-10 18:56:51 +0000
commita7d0cdf95fd8847ab76b35446e1c9b77f8ef1cb7 (patch)
tree1a1c59c13ddb1d152052f3a3a0bcffe4fb531173 /src/string.cpp
parentce75f6549dd379b506c9f1e9383bd881aa7cf5c7 (diff)
downloadopenttd-a7d0cdf95fd8847ab76b35446e1c9b77f8ef1cb7.tar.xz
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
Diffstat (limited to 'src/string.cpp')
-rw-r--r--src/string.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/string.cpp b/src/string.cpp
index dba2c7131..7e4aaf1d2 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -6,6 +6,7 @@
#include "string.h"
#include "macros.h"
#include "table/control_codes.h"
+#include "helpers.hpp"
#include <stdarg.h>
#include <ctype.h> // required for tolower()
@@ -63,7 +64,7 @@ char* CDECL str_fmt(const char* str, ...)
va_start(va, str);
len = vsnprintf(buf, lengthof(buf), str, va);
va_end(va);
- p = malloc(len + 1);
+ MallocT(&p, len + 1);
if (p != NULL) memcpy(p, buf, len + 1);
return p;
}