Update xdrv_50_filesystem.ino

This commit is contained in:
Christian Baars 2022-01-09 18:24:39 +01:00 committed by GitHub
parent 2852552fda
commit e64ee7b13f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

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;