Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0ab2c58

Browse filesBrowse files
FS library position() to return (size_t) -1 on error (espressif#10002)
* position_fix Fix for error return from position() Issue espressif#9992 * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent 0adf787 commit 0ab2c58
Copy full SHA for 0ab2c58

File tree

2 files changed

+2
-2
lines changed
Filter options

2 files changed

+2
-2
lines changed

‎libraries/FS/src/FS.cpp

Copy file name to clipboardExpand all lines: libraries/FS/src/FS.cpp
+1-1Lines changed: 1 addition & 1 deletion
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 0;
108+
return (size_t)-1;
109109
}
110110

111111
return _p->position();

‎libraries/FS/src/FS.h

Copy file name to clipboardExpand all lines: libraries/FS/src/FS.h
+1-1Lines changed: 1 addition & 1 deletion
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;
67+
size_t position() const; // returns (size_t)-1 on error
6868
size_t size() const;
6969
bool setBufferSize(size_t size);
7070
void close();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.