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:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user