Zero-size file cannot be seek #57

Thanks @lishen2
This commit is contained in:
Peter Andersson
2015-11-03 18:30:12 +01:00
parent 47a8d66581
commit a4678ce54e
+1 -1
View File
@@ -500,7 +500,7 @@ s32_t SPIFFS_lseek(spiffs *fs, spiffs_file fh, s32_t offs, int whence) {
break;
}
if (offs > (s32_t)fd->size) {
if ((offs > (s32_t)fd->size) && (SPIFFS_UNDEFINED_LEN != fd->size)) {
res = SPIFFS_ERR_END_OF_OBJECT;
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);