1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-01 10:59:12 +00:00

Codechange: rename str_validate to StrMakeValid(InPlace) (#9304)

This to be more explicit the function changes the value, and not
returns yes/no.
This commit is contained in:
Patric Stout
2021-05-29 11:21:38 +02:00
committed by GitHub
parent 4d74e51907
commit ca9a7df752
22 changed files with 63 additions and 62 deletions

View File

@@ -375,7 +375,7 @@ static void Xunzip(byte **bufp, size_t *sizep)
this->text = ReallocT(this->text, filesize + 1);
this->text[filesize] = '\0';
/* Replace tabs and line feeds with a space since str_validate removes those. */
/* Replace tabs and line feeds with a space since StrMakeValidInPlace removes those. */
for (char *p = this->text; *p != '\0'; p++) {
if (*p == '\t' || *p == '\r') *p = ' ';
}
@@ -384,7 +384,7 @@ static void Xunzip(byte **bufp, size_t *sizep)
char *p = this->text + (strncmp(u8"\ufeff", this->text, 3) == 0 ? 3 : 0);
/* Make sure the string is a valid UTF-8 sequence. */
str_validate(p, this->text + filesize, SVS_REPLACE_WITH_QUESTION_MARK | SVS_ALLOW_NEWLINE);
StrMakeValidInPlace(p, this->text + filesize, SVS_REPLACE_WITH_QUESTION_MARK | SVS_ALLOW_NEWLINE);
/* Split the string on newlines. */
int row = 0;