-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FS library position() to return (size_t) -1 on error #10002
Conversation
Fix for error return from position() Issue espressif#9992
👋 Hello drmpf, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
Would it make sense to change the return type to |
@igrr it is now exactly the same as in official SD lib. While surely we do agree that unsigned returning -1 is wrong, it is what ends up being done upstream. |
No what is actually being returned here is NOT -1, |
Yes @drmpf , but |
Yes but ULONG_MAX a very (edit: unlikely) file position and far more unlikely a return value for a file position than 0. |
…if#10002)" This reverts commit 0ab2c58. Fixes: espressif#10360
Fix for error return from position()
PR Issue #9992
Description of Change
Currently FS::position() returns 0 if file is invalid, this change return (size_t) -1 instead, which is a very large number, to indicate an error
Tests scenarios
none
Related links
Closes #9992