Check whether failbit or badbit are set in filefuncs.cpp
This commit is contained in:
parent
c7f6a3eba9
commit
379a230765
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue