Fixed problem with file size 0.

pull/3/head
yhirose 9 years ago
parent 4f7686cf79
commit 90fbf9b541
  1. 4
      lint/peglint.cc

@ -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…
Cancel
Save