1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-15 16:32:41 +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

@@ -51,7 +51,8 @@ static std::optional<std::string> FindGameManualFilePath(std::string_view filena
};
for (Searchpath sp : searchpaths) {
auto file_path = FioGetDirectory(sp, subdir) + filename.data();
std::string file_path = FioGetDirectory(sp, subdir);
file_path.append(filename);
if (FioCheckFileExists(file_path, NO_DIRECTORY)) return file_path;
}