mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 11:46:31 +00:00
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
|
AddLog(LOG_LEVEL_INFO, PSTR("TFS: File '%s' not found"), fname +1); // Skip leading slash
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t flen = file.size();
|
||||||
|
if (len > flen){
|
||||||
|
len = flen;
|
||||||
|
}
|
||||||
|
|
||||||
file.read(buf, len);
|
file.read(buf, len);
|
||||||
file.close();
|
file.close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user