(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 a2b3d77df8
commit 47a61fb10c
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++ = '?';
}
}