server: avoid the tcl server crashing when there is no target

Since commit 1d0cf0df37
("server: tcl_notifications command") connecting to the tcl server
would terminate openocd. Fix this.

Change-Id: I36e2a7482f7db3a30ff7e9f969c3b6cda9599382
Signed-off-by: Austin Morton <austinpmorton@gmail.com>
Reviewed-on: http://openocd.zylin.com/2759
Tested-by: jenkins
Reviewed-by: Forest Crossman <cyrozap@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
This commit is contained in:
Austin Morton
2015-05-02 18:00:37 -04:00
committed by Paul Fertser
parent 8de17eb65a
commit 38cb629ddf
3 changed files with 3 additions and 2 deletions

View File

@@ -486,7 +486,7 @@ struct target *get_target(const char *id)
}
/* returns a pointer to the n-th configured target */
static struct target *get_target_by_num(int num)
struct target *get_target_by_num(int num)
{
struct target *target = all_targets;