Skip to content

Commit 4fde325

Browse files
committed
Revert "FS library position() to return (size_t) -1 on error (#10002)"
This reverts commit 0ab2c58. Fixes: #10360
1 parent 7018cd1 commit 4fde325

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libraries/FS/src/FS.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ bool File::seek(uint32_t pos, SeekMode mode) {
105105

106106
size_t File::position() const {
107107
if (!*this) {
108-
return (size_t)-1;
108+
return 0;
109109
}
110110

111111
return _p->position();

libraries/FS/src/FS.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class File : public Stream {
6464
bool seek(uint32_t pos) {
6565
return seek(pos, SeekSet);
6666
}
67-
size_t position() const; // returns (size_t)-1 on error
67+
size_t position() const;
6868
size_t size() const;
6969
bool setBufferSize(size_t size);
7070
void close();

0 commit comments

Comments
 (0)