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:
@@ -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++ = '?';
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user