(svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL)

This commit is contained in:
rubidium
2014-04-25 15:40:32 +00:00
parent 4227f495c5
commit 9ed12b0f07
70 changed files with 207 additions and 183 deletions

View File

@@ -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)