stm32l0: Fix crash when only "monitor option" was requested.

PR #485
This commit is contained in:
Uwe Bonnes 2019-06-12 12:37:01 +02:00 committed by UweBonnes
parent 21434d6fbb
commit 589d297d20
1 changed files with 2 additions and 4 deletions

View File

@ -609,6 +609,8 @@ static bool stm32lx_cmd_option(target* t, int argc, char** argv)
return true;
}
if (argc < 2 )
goto usage;
size_t cb = strlen(argv[1]);
if (argc == 2 && !strncasecmp(argv[1], "obl_launch", cb)) {
@ -638,10 +640,6 @@ static bool stm32lx_cmd_option(target* t, int argc, char** argv)
if (!stm32lx_option_write(t, addr, val))
tc_printf(t, "option write failed\n");
}
else if (argc == 2 && !strncasecmp(argv[1], "show", cb))
;
else
goto usage;
/* Report the current option values */
for(unsigned i = 0; i < opt_size; i += sizeof(uint32_t)) {