diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 75c3a89204..5e018d2849 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -73,7 +73,13 @@ public: { throw std::runtime_error("Unable to open " + path); } - return std::string((std::istreambuf_iterator(fs)), std::istreambuf_iterator()); + fs.seekg(0, fs.end); + auto length = fs.tellg(); + fs.seekg(0, fs.beg); + std::unique_ptr buffer = std::make_unique(length); + fs.read(buffer.get(), length); + auto result = std::string(buffer.get(), buffer.get() + length); + return result; } /**