mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-15 05:47:38 +00:00
File: Make incomplete write()s return FR_DISK_FULL.
This commit is contained in:
@@ -78,7 +78,11 @@ File::Result<size_t> File::write(const void* const data, const size_t bytes_to_w
|
|||||||
UINT bytes_written = 0;
|
UINT bytes_written = 0;
|
||||||
const auto result = f_write(&f, data, bytes_to_write, &bytes_written);
|
const auto result = f_write(&f, data, bytes_to_write, &bytes_written);
|
||||||
if( result == FR_OK ) {
|
if( result == FR_OK ) {
|
||||||
|
if( bytes_to_write == bytes_written ) {
|
||||||
return { static_cast<size_t>(bytes_written) };
|
return { static_cast<size_t>(bytes_written) };
|
||||||
|
} else {
|
||||||
|
return Error { FR_DISK_FULL };
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return { static_cast<Error>(result) };
|
return { static_cast<Error>(result) };
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user