From 01f32a660fa8c4e449af8769362f8c5c773cb025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 7 May 2023 20:00:37 +0200 Subject: [PATCH] Fix length calculation --- src/openrct2-ui/windows/Changelog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index d61be74075..39165e71f3 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -73,7 +73,7 @@ public: { throw std::runtime_error("Unable to open " + path); } - auto length = fs.tellg(); + auto length = fs.end - fs.beg; std::unique_ptr buffer = std::make_unique(length); fs.read(buffer.get(), length); auto result = std::string(buffer.get(), buffer.get() + length);