(svn r25555) -Fix [FS#5632]: [Script] Texts from scripts were not validated before they were shown, causing an assertion to trigger
This commit is contained in:
@@ -254,6 +254,18 @@ void str_validate(char *str, const char *last, StringValidationSettings settings
|
||||
*dst = '\0';
|
||||
}
|
||||
|
||||
/**
|
||||
* Scans the string for valid characters and if it finds invalid ones,
|
||||
* replaces them with a question mark '?'.
|
||||
* @param str the string to validate
|
||||
*/
|
||||
void ValidateString(const char *str)
|
||||
{
|
||||
/* We know it is '\0' terminated. */
|
||||
str_validate(const_cast<char *>(str), str + strlen(str) + 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks whether the given string is valid, i.e. contains only
|
||||
* valid (printable) characters and is properly terminated.
|
||||
|
Reference in New Issue
Block a user