Check whether failbit or badbit are set in filefuncs.cpp

This commit is contained in:
Username404 2021-12-29 19:19:23 +01:00
parent c7f6a3eba9
commit 379a230765
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@ using namespace std;
string getFileContent(const string& file)
{
ifstream fileStream(file, ios::in);
if (not fileStream.fail()) {
if (fileStream) {
string lineinput, fullinput;
while (getline(fileStream, lineinput)) {
fullinput.append(lineinput += '\n');