summaryrefslogtreecommitdiff
path: root/src/textfile_gui.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-05-29 11:21:38 +0200
committerGitHub <noreply@github.com>2021-05-29 11:21:38 +0200
commitca9a7df7522a614b839a83e1ba9b6a7b08642b8a (patch)
tree172dedad1d930ef7699838272e779c9d7218319b /src/textfile_gui.cpp
parent4d74e519074bec9a07c2997715ab635ac0e8f084 (diff)
downloadopenttd-ca9a7df7522a614b839a83e1ba9b6a7b08642b8a.tar.xz
Codechange: rename str_validate to StrMakeValid(InPlace) (#9304)
This to be more explicit the function changes the value, and not returns yes/no.
Diffstat (limited to 'src/textfile_gui.cpp')
-rw-r--r--src/textfile_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp
index d6c37a458..e9223af70 100644
--- a/src/textfile_gui.cpp
+++ b/src/textfile_gui.cpp
@@ -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;