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:
Jared Boone 2016-07-24 19:13:39 -07:00
parent d556ef38b4
commit ff17f8f293

View File

@ -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) };
}
}