From 48bb561c175fb80ef76b243a7effe310649edc28 Mon Sep 17 00:00:00 2001 From: apio Date: Fri, 4 Nov 2022 20:16:11 +0100 Subject: [PATCH] Allow -1 characters while reading a file --- src/App.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App.cpp b/src/App.cpp index 144b319..2e8cd7f 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -298,7 +298,8 @@ static std::string read_whole_file(std::ifstream& file) while(file.good()) { char ch = file.get(); - if(ch != -1) result.push_back(ch); + if(!file.good()) break; + result.push_back(ch); } return std::move(result); }