diff --git a/cores/esp8266/spiffs_api.h b/cores/esp8266/spiffs_api.h index 612b014b8a..4ce8d3e6ba 100644 --- a/cores/esp8266/spiffs_api.h +++ b/cores/esp8266/spiffs_api.h @@ -329,7 +329,7 @@ class SPIFFSFileImpl : public FileImpl if (mode == SeekEnd) { offset = -offset; } - auto rc = SPIFFS_lseek(_fs->getFs(), _fd, pos, (int) mode); + auto rc = SPIFFS_lseek(_fs->getFs(), _fd, offset, (int) mode); if (rc < 0) { DEBUGV("SPIFFS_lseek rc=%d\r\n", rc); return false;