FS library position() to return (size_t) -1 on error (#10002)
* position_fix Fix for error return from position() Issue #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>
This commit is contained in:
parent
0adf7873d1
commit
0ab2c58b6c
2 changed files with 2 additions and 2 deletions
|
|
@ -105,7 +105,7 @@ bool File::seek(uint32_t pos, SeekMode mode) {
|
||||||
|
|
||||||
size_t File::position() const {
|
size_t File::position() const {
|
||||||
if (!*this) {
|
if (!*this) {
|
||||||
return 0;
|
return (size_t)-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return _p->position();
|
return _p->position();
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ public:
|
||||||
bool seek(uint32_t pos) {
|
bool seek(uint32_t pos) {
|
||||||
return seek(pos, SeekSet);
|
return seek(pos, SeekSet);
|
||||||
}
|
}
|
||||||
size_t position() const;
|
size_t position() const; // returns (size_t)-1 on error
|
||||||
size_t size() const;
|
size_t size() const;
|
||||||
bool setBufferSize(size_t size);
|
bool setBufferSize(size_t size);
|
||||||
void close();
|
void close();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue