summaryrefslogtreecommitdiff
path: root/src/script/squirrel_helper.hpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-04-25 15:40:32 +0000
committerrubidium <rubidium@openttd.org>2014-04-25 15:40:32 +0000
commit9ed12b0f07edb342aaff21c130d325fd158a9d5b (patch)
treef42aa775396b4ebda4d119f76e80a77c180936c7 /src/script/squirrel_helper.hpp
parent4227f495c51ea909707505ec2ef1c730a382965d (diff)
downloadopenttd-9ed12b0f07edb342aaff21c130d325fd158a9d5b.tar.xz
(svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL)
Diffstat (limited to 'src/script/squirrel_helper.hpp')
-rw-r--r--src/script/squirrel_helper.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/squirrel_helper.hpp b/src/script/squirrel_helper.hpp
index 3e3764384..ff00712c0 100644
--- a/src/script/squirrel_helper.hpp
+++ b/src/script/squirrel_helper.hpp
@@ -26,7 +26,7 @@ template <class CL, ScriptType ST> const char *GetClassName();
namespace SQConvert {
/**
* Pointers assigned to this class will be free'd when this instance
- * comes out of scope. Useful to make sure you can use strdup(),
+ * comes out of scope. Useful to make sure you can use stredup(),
* without leaking memory.
*/
struct SQAutoFreePointers : SmallVector<void *, 1> {
@@ -113,7 +113,7 @@ namespace SQConvert {
const SQChar *tmp;
sq_getstring(vm, -1, &tmp);
- char *tmp_str = strdup(SQ2OTTD(tmp));
+ char *tmp_str = stredup(SQ2OTTD(tmp));
sq_poptop(vm);
*ptr->Append() = (void *)tmp_str;
str_validate(tmp_str, tmp_str + strlen(tmp_str));