coverity: fgetc could also fail for other reasons than feof

This commit is contained in:
folkert van heusden 2024-04-28 01:27:42 +02:00
parent 5fdda24365
commit 09f3117fd1
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1

View file

@ -207,7 +207,11 @@ std::optional<uint16_t> 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;