X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=cmd%2Ffat.c;h=ad1dc2a49f1162ce52eaab706817bbbec5aeef8e;hb=0405092bd21a44f5af22f17aeb0b82a0a11e1252;hp=4e207462d93e9a1301d32b2a379e29149251a351;hpb=88033d737d9f46e7eebda6a8f9770957eb9aae9c;p=u-boot diff --git a/cmd/fat.c b/cmd/fat.c index 4e207462d9..ad1dc2a49f 100644 --- a/cmd/fat.c +++ b/cmd/fat.c @@ -126,7 +126,7 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag, return 1; } addr = simple_strtoul(argv[3], NULL, 16); - count = simple_strtoul(argv[5], NULL, 16); + count = (argc <= 5) ? 0 : simple_strtoul(argv[5], NULL, 16); buf = map_sysmem(addr, count); ret = file_fat_write(argv[4], buf, 0, count, &size); @@ -145,7 +145,7 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag, U_BOOT_CMD( fatwrite, 6, 0, do_fat_fswrite, "write file into a dos filesystem", - " \n" + " []\n" " - write file 'filename' from the address 'addr' in RAM\n" " to 'dev' on 'interface'" );