diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 39165e71f3..5e018d2849 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -73,7 +73,9 @@ public: { throw std::runtime_error("Unable to open " + path); } - auto length = fs.end - fs.beg; + 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);