mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-14 12:42:19 -04: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
1 changed files with 1 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue