1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 09:29:10 +00:00

(svn r15316) -Fix [NoAI]: ignore unprintable chars when returning a string to squirrel

This commit is contained in:
glx
2009-02-02 13:46:26 +00:00
parent c6bc3b8692
commit 6d6e2232ea
3 changed files with 6 additions and 5 deletions

View File

@@ -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++ = '?';
}
}