Skip to content

Commit a638e87

Browse files
Kees Bakkersandeepmistry
Kees Bakker
authored andcommitted
File open with O_WRITE would always append, even when O_APPEND is off
1 parent d27d703 commit a638e87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/SD.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ File SDClass::open(const char *filepath, uint8_t mode) {
470470
parentdir.close();
471471
}
472472

473-
if (mode & (O_APPEND | O_WRITE))
473+
if ((mode & (O_APPEND | O_WRITE)) == (O_APPEND | O_WRITE))
474474
file.seekSet(file.fileSize());
475475
return File(file, filepath);
476476
}

0 commit comments

Comments
 (0)