mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 03:34:35 +00:00
File: Do not use f_error() in puts(), it doesn't return the reason for failure.
TODO: Improve puts() behavior to return a more specific error than FR_EOF.
This commit is contained in:
parent
d556ef38b4
commit
ff17f8f293
@ -105,10 +105,8 @@ File::Result<size_t> File::puts(const std::string& string) {
|
||||
const auto result = f_puts(string.c_str(), &f);
|
||||
if( result >= 0 ) {
|
||||
return { static_cast<size_t>(result) };
|
||||
} else if( result == EOF ) {
|
||||
return { static_cast<Error>(f_error(&f)) };
|
||||
} else {
|
||||
return { static_cast<Error>(FR_UNEXPECTED) };
|
||||
return { static_cast<Error>(FR_EOF) };
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user