summaryrefslogtreecommitdiff
path: root/src/saveload
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/saveload
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/saveload')
-rw-r--r--src/saveload/oldloader.cpp2
-rw-r--r--src/saveload/saveload.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/saveload/oldloader.cpp b/src/saveload/oldloader.cpp
index 6bc07ad27..74a1466da 100644
--- a/src/saveload/oldloader.cpp
+++ b/src/saveload/oldloader.cpp
@@ -234,7 +234,7 @@ static inline bool CheckOldSavegameType(FILE *f, char *temp, const char *last, u
bool ret = VerifyOldNameChecksum(temp, len);
temp[len - 2] = '\0'; // name is null-terminated in savegame, but it's better to be sure
- str_validate(temp, last);
+ StrMakeValidInPlace(temp, last);
return ret;
}
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index 442ab9135..9a9ed7cc5 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -972,7 +972,7 @@ static void SlString(void *ptr, size_t length, VarType conv)
if ((conv & SLF_ALLOW_NEWLINE) != 0) {
settings = settings | SVS_ALLOW_NEWLINE;
}
- str_validate((char *)ptr, (char *)ptr + len, settings);
+ StrMakeValidInPlace((char *)ptr, (char *)ptr + len, settings);
break;
}
case SLA_PTRS: break;
@@ -1016,7 +1016,7 @@ static void SlStdString(void *ptr, VarType conv)
if ((conv & SLF_ALLOW_NEWLINE) != 0) {
settings = settings | SVS_ALLOW_NEWLINE;
}
- str_validate(buf, buf + len, settings);
+ StrMakeValidInPlace(buf, buf + len, settings);
// Store sanitized string.
str->assign(buf);