summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/target/target.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/target/target.c b/src/target/target.c
index 260f9cec..b207ac95 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -1912,11 +1912,13 @@ static int handle_soft_reset_halt_command(struct command_context_s *cmd_ctx, cha
static int handle_reset_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
- const Jim_Nvp *n;
- enum target_reset_mode reset_mode = RESET_RUN;
+ if (argc > 1)
+ return ERROR_COMMAND_SYNTAX_ERROR;
- if (argc >= 1)
+ enum target_reset_mode reset_mode = RESET_RUN;
+ if (argc == 1)
{
+ const Jim_Nvp *n;
n = Jim_Nvp_name2value_simple( nvp_reset_modes, args[0] );
if( (n->name == NULL) || (n->value == RESET_UNKNOWN) ){
return ERROR_COMMAND_SYNTAX_ERROR;