diff --git a/loaders.cpp b/loaders.cpp index 8752141..5a809a2 100644 --- a/loaders.cpp +++ b/loaders.cpp @@ -207,7 +207,11 @@ std::optional load_tape(bus *const b, const std::string & file) break; } - uint8_t c = fgetc(fh); + int c = fgetc(fh); + if (c == -1) { + DOLOG(warning, true, "read failure"); + break; + } #endif csum += c;