Skip to content

Commit 4a26462

Browse files
committed
Truncate should return false when performed on a directory.
1 parent 778529c commit 4a26462

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/Adafruit_LittleFS/src/Adafruit_LittleFS_File.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ uint32_t File::size (void)
274274

275275
bool File::truncate (uint32_t pos)
276276
{
277-
uint32_t ret=0;
277+
uint32_t ret=1;
278278
_fs->_lockFS();
279279
if (!this->_is_dir)
280280
{
@@ -286,7 +286,7 @@ bool File::truncate (uint32_t pos)
286286

287287
bool File::truncate (void)
288288
{
289-
uint32_t ret=0;
289+
uint32_t ret=1;
290290
uint32_t pos;
291291
_fs->_lockFS();
292292
if (!this->_is_dir)

0 commit comments

Comments
 (0)