mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
File: Make incomplete write()s return FR_DISK_FULL.
This commit is contained in:
parent
931853a55f
commit
d556ef38b4
@ -78,7 +78,11 @@ File::Result<size_t> File::write(const void* const data, const size_t bytes_to_w
|
||||
UINT bytes_written = 0;
|
||||
const auto result = f_write(&f, data, bytes_to_write, &bytes_written);
|
||||
if( result == FR_OK ) {
|
||||
return { static_cast<size_t>(bytes_written) };
|
||||
if( bytes_to_write == bytes_written ) {
|
||||
return { static_cast<size_t>(bytes_written) };
|
||||
} else {
|
||||
return Error { FR_DISK_FULL };
|
||||
}
|
||||
} else {
|
||||
return { static_cast<Error>(result) };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user