Skip to content

Commit

Permalink
Revert "FS library position() to return (size_t) -1 on error (#10002)"
Browse files Browse the repository at this point in the history
This reverts commit 0ab2c58.
Fixes: #10360
  • Loading branch information
TD-er committed Sep 20, 2024
1 parent 7018cd1 commit 4fde325
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libraries/FS/src/FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ bool File::seek(uint32_t pos, SeekMode mode) {

size_t File::position() const {
if (!*this) {
return (size_t)-1;
return 0;
}

return _p->position();
Expand Down
2 changes: 1 addition & 1 deletion libraries/FS/src/FS.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class File : public Stream {
bool seek(uint32_t pos) {
return seek(pos, SeekSet);
}
size_t position() const; // returns (size_t)-1 on error
size_t position() const;
size_t size() const;
bool setBufferSize(size_t size);
void close();
Expand Down

0 comments on commit 4fde325

Please sign in to comment.