Merge pull request #14348 from Staars/patch-5

xdrv_50_filesystem.ino - adjust file size automatically
This commit is contained in:
Theo Arends 2022-01-09 18:45:35 +01:00 committed by GitHub
commit d2bf4e9f2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -349,6 +349,11 @@ bool TfsLoadFile(const char *fname, uint8_t *buf, uint32_t len) {
return false;
}
size_t flen = file.size();
if (len > flen){
len = flen;
}
file.read(buf, len);
file.close();
return true;