Fix length calculation

This commit is contained in:
Michał Janiszewski committed 2023-05-07 20:00:37 +02:00
1 parent 851632510f
commit 01f32a660f
1 file changed
+1 -1
+1 -1
View File
@@ -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<char[]> buffer = std::make_unique<char[]>(length);
fs.read(buffer.get(), length);
auto result = std::string(buffer.get(), buffer.get() + length);