File allocation fix

mkimg would create files 1/1048576 in size compared to the request.
This commit is contained in:
David Kuder 2022-06-11 10:56:21 -04:00
parent cf468bcbde
commit 5aeb32e928
1 changed files with 1 additions and 1 deletions

View File

@ -1196,7 +1196,7 @@ void makeimagecmd(int argc, char **argv) {
Serial.printf(": Unable to open '%s'.\r\n", tmp_path);
} else {
// Take advantage of our cylinders being 1MB
if(!file.preAllocate(cyl)) {
if(!file.preAllocate(fileSize)) {
file.close();
sd.remove(tmp_path+3);