From 613e2f7019c94c5215e41519a34fc71b5fbdce53 Mon Sep 17 00:00:00 2001 From: Username404 Date: Sun, 3 Oct 2021 15:21:18 +0200 Subject: [PATCH] Initialize the fileStream local variable instead of calling ifstream::open in filefuncs.cpp --- src/etc/filefuncs.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/etc/filefuncs.cpp b/src/etc/filefuncs.cpp index cf60189..227662b 100644 --- a/src/etc/filefuncs.cpp +++ b/src/etc/filefuncs.cpp @@ -4,9 +4,8 @@ using namespace std; string getFileContent(const string& file) { - ifstream fileStream; + ifstream fileStream(file, ios::in); string lineinput, fullinput; - fileStream.open(file, ios::in); if (fileStream.is_open()) while (getline(fileStream, lineinput)) { fullinput.append(lineinput += '\n'); } else throw Yerbacon::Exception("Could not open \"" + file + "\".");