]> git.sur5r.net Git - openocd/blobdiff - src/server/tcl_server.c
target: use correct target in target-prefixed commands and event handlers
[openocd] / src / server / tcl_server.c
index 0077339f23c915abd0c92e8d52a72bf99b64f483..7c40f7dce9c49908e09b234183137288f6ebc2ae 100644 (file)
@@ -157,7 +157,7 @@ static int tcl_new_connection(struct connection *connection)
 
        connection->priv = tclc;
 
-       struct target *target = get_target_by_num(connection->cmd_ctx->current_target);
+       struct target *target = get_current_target(connection->cmd_ctx);
        if (target != NULL)
                tclc->tc_laststate = target->state;