From ff17f8f2935a7dcddc34941630b38ca2f195f41c Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Sun, 24 Jul 2016 19:13:39 -0700 Subject: [PATCH] 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. --- firmware/application/file.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/firmware/application/file.cpp b/firmware/application/file.cpp index fa0658fed..814f3bde6 100644 --- a/firmware/application/file.cpp +++ b/firmware/application/file.cpp @@ -105,10 +105,8 @@ File::Result File::puts(const std::string& string) { const auto result = f_puts(string.c_str(), &f); if( result >= 0 ) { return { static_cast(result) }; - } else if( result == EOF ) { - return { static_cast(f_error(&f)) }; } else { - return { static_cast(FR_UNEXPECTED) }; + return { static_cast(FR_EOF) }; } }