changeset 18928:cb724321a831 draft

(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.
author rubidium <rubidium@openttd.org>
date Sun, 08 Jan 2012 21:51:08 +0000
parents dcd4ce0e5ea9
children fbb3ac796271
files src/script/api/script_object.cpp
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/script/api/script_object.cpp
+++ b/src/script/api/script_object.cpp
@@ -239,6 +239,7 @@
 {
 	char buffer[64];
 	::GetString(buffer, string, lastof(buffer));
+	::str_validate(buffer, lastof(buffer), SVS_NONE);
 	return ::strdup(buffer);
 }