Fixed problem with file size 0.

This commit is contained in:
yhirose 2015-02-25 19:29:42 -05:00
parent 4f7686cf79
commit 90fbf9b541

View File

@ -18,7 +18,9 @@ bool read_file(const char* path, vector<char>& buff)
}
buff.resize(static_cast<unsigned int>(ifs.seekg(0, ios::end).tellg()));
ifs.seekg(0, ios::beg).read(&buff[0], static_cast<streamsize>(buff.size()));
if (!buff.empty()) {
ifs.seekg(0, ios::beg).read(&buff[0], static_cast<streamsize>(buff.size()));
}
return true;
}