1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 17:02:37 +01:00

Codefix: std::string_view::data() is not necessarily null terminated. (#13891)

This commit is contained in:
frosch
2025-03-25 20:32:19 +01:00
committed by GitHub
parent 93016b9a92
commit 25005cff16
7 changed files with 10 additions and 9 deletions

View File

@@ -128,7 +128,7 @@ bool ScriptInstance::LoadCompatibilityScript(std::string_view api_version, Subdi
bool ScriptInstance::LoadCompatibilityScripts(Subdirectory dir, std::span<const std::string_view> api_versions)
{
/* Don't try to load compatibility scripts for the current version. */
if (this->versionAPI == std::rbegin(api_versions)->data()) return true;
if (this->versionAPI == api_versions.back()) return true;
ScriptLog::Info(fmt::format("Downgrading API to be compatible with version {}", this->versionAPI));