1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Merge pull request #20143 from janisozaur/gcc-13.1

Fix compatibility with GCC 13.1
This commit is contained in:
Matthias Moninger
2023-05-07 22:09:17 +03:00
committed by GitHub

View File

@@ -73,7 +73,13 @@ public:
{
throw std::runtime_error("Unable to open " + path);
}
return std::string((std::istreambuf_iterator<char>(fs)), std::istreambuf_iterator<char>());
fs.seekg(0, fs.end);
auto length = fs.tellg();
fs.seekg(0, fs.beg);
std::unique_ptr<char[]> buffer = std::make_unique<char[]>(length);
fs.read(buffer.get(), length);
auto result = std::string(buffer.get(), buffer.get() + length);
return result;
}
/**