mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #20143 from janisozaur/gcc-13.1
Fix compatibility with GCC 13.1
This commit is contained in:
commit
4afa56e373
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue