Skip to content

Commit e3e93a3

Browse files
committed
main: SPI mode without board: check file_size (must be > 0)
1 parent dd3204a commit e3e93a3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,10 @@ int main(int argc, char **argv)
380380

381381
delete bit;
382382
} else if (args.prg_type == Device::RD_FLASH) {
383-
flash.dump(args.bit_file, args.offset, args.file_size);
383+
if (args.file_size == 0)
384+
printError("Error: 0 size for dump");
385+
else
386+
flash.dump(args.bit_file, args.offset, args.file_size);
384387
}
385388

386389
if (args.unprotect_flash && args.bit_file.empty())

0 commit comments

Comments
 (0)