Command upgrading introduced two off-by-one bugs in the flash commands.
This patch fixes the 'flash {protect,erase_sector}' commands to check
that they have been passed the correct number of arguments.
Ammended during commit to fix help text for 'erase_address' too.
COMMAND_HANDLER(handle_flash_erase_command)
{
- if (CMD_ARGC != 2)
+ if (CMD_ARGC != 3)
return ERROR_COMMAND_SYNTAX_ERROR;
uint32_t bank_nr;
COMMAND_HANDLER(handle_flash_protect_command)
{
- if (CMD_ARGC != 3)
+ if (CMD_ARGC != 4)
return ERROR_COMMAND_SYNTAX_ERROR;
uint32_t bank_nr;
.name = "erase_address",
.handler = &handle_flash_erase_address_command,
.mode = COMMAND_EXEC,
- .usage = "<bank> <address> <length>",
+ .usage = "<address> <length>",
.help = "erase address range",
},