Disk: Predictable behavior for zero length reads

This commit is contained in:
Paul Hollinsky
2022-02-28 01:54:21 -05:00
parent f8a46b7196
commit 4ef8fe8794
4 changed files with 26 additions and 0 deletions
+3
View File
@@ -6,6 +6,9 @@ using namespace icsneo::Disk;
optional<uint64_t> ReadDriver::readLogicalDisk(Communication& com, device_eventhandler_t report,
uint64_t pos, uint8_t* into, uint64_t amount, std::chrono::milliseconds timeout) {
if(amount == 0)
return 0;
optional<uint64_t> ret;
// Read into here if we can't read directly into the user buffer