diff options
author | 2021-10-05 03:34:45 +1100 | |
---|---|---|
committer | 2021-10-05 03:34:45 +1100 | |
commit | aeb9eae87469e67bc6a91caf3840c34c11d959fc (patch) | |
tree | 45bffedf374dbce47caca633ad7bda547592e6c9 /src/lib/util/cdrom.cpp | |
parent | 33723892a3f06e678d817b36aef84364c32848ec (diff) |
util: Further API cleanups: (#8661)
* Turned `core_file` into an implementation of `random_read_write`.
* Turned PNG errors into a standard error category.
* Added a helper for generating what look like derived classes on-the-fly.
Diffstat (limited to 'src/lib/util/cdrom.cpp')
-rw-r--r-- | src/lib/util/cdrom.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/util/cdrom.cpp b/src/lib/util/cdrom.cpp index 7510a1f9b47..8545ed4725a 100644 --- a/src/lib/util/cdrom.cpp +++ b/src/lib/util/cdrom.cpp @@ -510,8 +510,11 @@ std::error_condition read_partial_sector(cdrom_file *file, void *dest, uint32_t // printf("Reading sector %d from track %d at offset %lu\n", chdsector, tracknum, sourcefileoffset); - srcfile.seek(sourcefileoffset, SEEK_SET); - srcfile.read(dest, length); + size_t actual; + result = srcfile.seek(sourcefileoffset, SEEK_SET); + if (!result) + result = srcfile.read(dest, length, actual); + // FIXME: if (actual < length) report error needswap = file->track_info.track[tracknum].swap; } |