From 9ed12b0f07edb342aaff21c130d325fd158a9d5b Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 25 Apr 2014 15:40:32 +0000 Subject: (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) --- src/script/api/script_error.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/script/api/script_error.cpp') diff --git a/src/script/api/script_error.cpp b/src/script/api/script_error.cpp index 9dd6ece19..d30ad9c66 100644 --- a/src/script/api/script_error.cpp +++ b/src/script/api/script_error.cpp @@ -12,6 +12,7 @@ #include "../../stdafx.h" #include "script_error.hpp" #include "../../core/bitmath_func.hpp" +#include "../../string_func.h" #include "../../safeguards.h" @@ -25,7 +26,7 @@ ScriptError::ScriptErrorMapString ScriptError::error_map_string = ScriptError::S /* static */ char *ScriptError::GetLastErrorString() { - return strdup((*error_map_string.find(ScriptError::GetLastError())).second); + return stredup((*error_map_string.find(ScriptError::GetLastError())).second); } /* static */ ScriptErrorType ScriptError::StringToError(StringID internal_string_id) -- cgit v1.2.3-54-g00ecf