From 5aeb32e928675d11c0cd40c2bc268cf6102dab46 Mon Sep 17 00:00:00 2001 From: David Kuder Date: Sat, 11 Jun 2022 10:56:21 -0400 Subject: [PATCH] File allocation fix mkimg would create files 1/1048576 in size compared to the request. --- src/cmd.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd.ino b/src/cmd.ino index c7bc825..8e096c2 100755 --- a/src/cmd.ino +++ b/src/cmd.ino @@ -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);