Initialize the fileStream local variable instead of calling ifstream::open in filefuncs.cpp

This commit is contained in:
Username404 2021-10-03 15:21:18 +02:00
parent 5cea9251bd
commit 613e2f7019
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1

View File

@ -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 + "\".");