mirror of https://github.com/arendst/Tasmota.git
Merge pull request #14348 from Staars/patch-5
xdrv_50_filesystem.ino - adjust file size automatically
This commit is contained in:
commit
d2bf4e9f2a
|
@ -348,6 +348,11 @@ bool TfsLoadFile(const char *fname, uint8_t *buf, uint32_t len) {
|
|||
AddLog(LOG_LEVEL_INFO, PSTR("TFS: File '%s' not found"), fname +1); // Skip leading slash
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t flen = file.size();
|
||||
if (len > flen){
|
||||
len = flen;
|
||||
}
|
||||
|
||||
file.read(buf, len);
|
||||
file.close();
|
||||
|
|
Loading…
Reference in New Issue