summaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2009-02-02 13:46:26 +0000
committerglx <glx@openttd.org>2009-02-02 13:46:26 +0000
commit47a61fb10c3af0f28a698f6cf81f34c22e56d6b2 (patch)
tree94d8b8fbeab32306eb82d2bdbbf2605b3372c849 /src/string.cpp
parenta2b3d77df8a9a03a5e8fed3171bb2ad28f0f4782 (diff)
downloadopenttd-47a61fb10c3af0f28a698f6cf81f34c22e56d6b2.tar.xz
(svn r15316) -Fix [NoAI]: ignore unprintable chars when returning a string to squirrel
Diffstat (limited to 'src/string.cpp')
-rw-r--r--src/string.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/string.cpp b/src/string.cpp
index 7a2f1aabb..8b22937ae 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -97,7 +97,7 @@ char *CDECL str_fmt(const char *str, ...)
}
-void str_validate(char *str, bool allow_newlines)
+void str_validate(char *str, bool allow_newlines, bool ignore)
{
char *dst = str;
WChar c;
@@ -122,7 +122,7 @@ void str_validate(char *str, bool allow_newlines)
assert(c != '\r');
/* Replace the undesirable character with a question mark */
str += len;
- *dst++ = '?';
+ if (!ignore) *dst++ = '?';
}
}