diff options
Diffstat (limited to 'src/lib/formats/ccvf_dsk.cpp')
-rw-r--r-- | src/lib/formats/ccvf_dsk.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/formats/ccvf_dsk.cpp b/src/lib/formats/ccvf_dsk.cpp index 829be2a0019..d2c8da8e083 100644 --- a/src/lib/formats/ccvf_dsk.cpp +++ b/src/lib/formats/ccvf_dsk.cpp @@ -50,8 +50,10 @@ const ccvf_format::format ccvf_format::file_formats[] = { int ccvf_format::identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const { char h[36]; - size_t actual; - io.read_at(0, h, 36, actual); + auto const [err, actual] = read_at(io, 0, h, 36); + if (err || (36 != actual)) + return 0; + if (!memcmp(h, "Compucolor Virtual Floppy Disk Image", 36)) return FIFID_SIGN; @@ -96,9 +98,9 @@ bool ccvf_format::load(util::random_read &io, uint32_t form_factor, const std::v if (io.length(size)) return false; - std::vector<uint8_t> img(size); - size_t actual; - io.read_at(0, &img[0], size, actual); + auto [err, img, actual] = read_at(io, 0, size); + if (err || (actual != size)) + return false; std::string ccvf = std::string((const char *)&img[0], size); std::vector<uint8_t> bytes(78720); |