diff options
author | truebrain <truebrain@openttd.org> | 2009-01-17 15:31:30 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2009-01-17 15:31:30 +0000 |
commit | 3abb8abd07e56b4b051d57cd6e6f1c56ab8bdb64 (patch) | |
tree | 14e7ce689d02dc05c06feede936f8d1c1bdb8c02 /src/ai/api/ai_error.cpp | |
parent | 7e8d9a3e667385113636cfc09d7cab4887591cf7 (diff) | |
download | openttd-3abb8abd07e56b4b051d57cd6e6f1c56ab8bdb64.tar.xz |
(svn r15123) -Fix [NoAI]: 'const char *' implies that the return value should not be free'd, which is should .. so make them 'char *'
Diffstat (limited to 'src/ai/api/ai_error.cpp')
-rw-r--r-- | src/ai/api/ai_error.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ai/api/ai_error.cpp b/src/ai/api/ai_error.cpp index 4c21db726..e060532d4 100644 --- a/src/ai/api/ai_error.cpp +++ b/src/ai/api/ai_error.cpp @@ -14,9 +14,9 @@ AIError::AIErrorMapString AIError::error_map_string = AIError::AIErrorMapString( return AIObject::GetLastError(); } -/* static */ const char *AIError::GetLastErrorString() +/* static */ char *AIError::GetLastErrorString() { - return (*error_map_string.find(AIError::GetLastError())).second; + return strdup((*error_map_string.find(AIError::GetLastError())).second); } /* static */ AIErrorType AIError::StringToError(StringID internal_string_id) |