summaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-11 11:42:47 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-11 11:42:47 +0000
commit57612ecf1d41f250c57725491ed442ebe6d75ef0 (patch)
tree1526a04144a06fb8cbc44c2069664a4277a854cf /src/target
parentd7ada2457e35d92edfe6bc9946f9c91bd6aeac9b (diff)
downloadopenocd_libswd-57612ecf1d41f250c57725491ed442ebe6d75ef0.tar.gz
openocd_libswd-57612ecf1d41f250c57725491ed442ebe6d75ef0.tar.bz2
openocd_libswd-57612ecf1d41f250c57725491ed442ebe6d75ef0.tar.xz
openocd_libswd-57612ecf1d41f250c57725491ed442ebe6d75ef0.zip
Simplify and fix target handle_rwp_command routine:
- Return syntax error unless exactly one argument is passed. - Move variable declaration to point of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2193 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target')
-rw-r--r--src/target/target.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/target/target.c b/src/target/target.c
index b207ac95..ea187ea5 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -2566,10 +2566,11 @@ static int handle_wp_command(struct command_context_s *cmd_ctx, char *cmd, char
static int handle_rwp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
- target_t *target = get_current_target(cmd_ctx);
+ if (argc != 1)
+ return ERROR_COMMAND_SYNTAX_ERROR;
- if (argc > 0)
- watchpoint_remove(target, strtoul(args[0], NULL, 0));
+ target_t *target = get_current_target(cmd_ctx);
+ watchpoint_remove(target, strtoul(args[0], NULL, 0));
return ERROR_OK;
}