mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 20:05:31 +00:00
Fixed problem with file size 0.
This commit is contained in:
parent
4f7686cf79
commit
90fbf9b541
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user