handle file eof when readBin

This commit is contained in:
Fire Cube 2025-05-03 21:50:44 +02:00
parent bcc65e7dd9
commit 6c8a792176

View File

@ -13,6 +13,10 @@ void writeBin(std::ostream& os, const T& v) {
}
template <typename T>
void readBin(std::istream& is, T& v) {
void readBin(std::istream& is, T& v) {
if (is.eof()) {
LOG_WARNING(Render_Recompiler, "BinaryHelper: EOF");
}
LOG_WARNING
is.read(reinterpret_cast<char*>(&v), sizeof(T));
}