Skip to content
Snippets Groups Projects
Commit 271bb81d authored by ntfreak's avatar ntfreak
Browse files

- fixes segfault using the targets cmd if multiple targets defined

git-svn-id: svn://svn.berlios.de/openocd/trunk@1187 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent 9a7bbada
No related branches found
No related tags found
No related merge requests found
...@@ -1362,7 +1362,7 @@ int handle_targets_command(struct command_context_s *cmd_ctx, char *cmd, char ** ...@@ -1362,7 +1362,7 @@ int handle_targets_command(struct command_context_s *cmd_ctx, char *cmd, char **
if (argc == 1) if (argc == 1)
{ {
/* try as tcltarget name */ /* try as tcltarget name */
for( target = all_targets ; target ; target++ ){ for( target = all_targets ; target ; target = target->next ){
if( target->cmd_name ){ if( target->cmd_name ){
if( 0 == strcmp( args[0], target->cmd_name ) ){ if( 0 == strcmp( args[0], target->cmd_name ) ){
/* MATCH */ /* MATCH */
...@@ -1388,8 +1388,9 @@ int handle_targets_command(struct command_context_s *cmd_ctx, char *cmd, char ** ...@@ -1388,8 +1388,9 @@ int handle_targets_command(struct command_context_s *cmd_ctx, char *cmd, char **
cmd_ctx->current_target = target->target_number; cmd_ctx->current_target = target->target_number;
return ERROR_OK; return ERROR_OK;
} }
DumpTargets: DumpTargets:
target = all_targets;
command_print(cmd_ctx, " CmdName Type Endian ChainPos State "); command_print(cmd_ctx, " CmdName Type Endian ChainPos State ");
command_print(cmd_ctx, "-- ---------- ---------- ---------- -------- ----------"); command_print(cmd_ctx, "-- ---------- ---------- ---------- -------- ----------");
while (target) while (target)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment