summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2012-01-08 21:51:08 +0000
committerrubidium <rubidium@openttd.org>2012-01-08 21:51:08 +0000
commitdf963509f6beede3b30c7e3d55422a8fb2971613 (patch)
treeefb2619777c8fc0c3e438759a0680a42d3fb9b38 /src
parent4479f90843d3597268f889a3955f3c5289b92e0a (diff)
downloadopenttd-df963509f6beede3b30c7e3d55422a8fb2971613.tar.xz
(svn r23778) -Fix [FS#4957]: trim all control codes and the likes from strings being passed into the AI. If the AI would be displaying them later we would be showing those control codes as question marks.
Diffstat (limited to 'src')
-rw-r--r--src/script/api/script_object.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp
index f56bce0c0..a4c4549be 100644
--- a/src/script/api/script_object.cpp
+++ b/src/script/api/script_object.cpp
@@ -239,6 +239,7 @@ ScriptObject::ActiveInstance::~ActiveInstance()
{
char buffer[64];
::GetString(buffer, string, lastof(buffer));
+ ::str_validate(buffer, lastof(buffer), SVS_NONE);
return ::strdup(buffer);
}