From 2d6c042179c99dd9b75bcee159fd10026fdc578e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnim=20L=C3=A4uger?= Date: Tue, 2 Jun 2009 22:54:38 +0000 Subject: [PATCH] use separate index variable for driver selection git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1641 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 4 ++++ urjtag/src/cmd/cmd_initbus.c | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index e513b78d..d2b7f9f1 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,7 @@ +2009-06-02 Arnim Laeuger + + * src/cmd/cmd_initbus.c: use separate index variable for driver selection + 2009-06-01 Arnim Laeuger * src/bsdl/bsdl_sem.c, THANKS: Fix bsdl bit order and safe bit diff --git a/urjtag/src/cmd/cmd_initbus.c b/urjtag/src/cmd/cmd_initbus.c index 1e2f5ee5..93b91e6c 100644 --- a/urjtag/src/cmd/cmd_initbus.c +++ b/urjtag/src/cmd/cmd_initbus.c @@ -40,7 +40,7 @@ static int cmd_initbus_run (urj_chain_t *chain, char *params[]) { - int i; + int drv, i; const urj_param_t **bus_params; if (urj_cmd_params (params) < 2) @@ -57,11 +57,11 @@ cmd_initbus_run (urj_chain_t *chain, char *params[]) if (urj_tap_chain_active_part (chain) == NULL) return URJ_STATUS_FAIL; - for (i = 0; urj_bus_drivers[i] != NULL; i++) - if (strcasecmp (urj_bus_drivers[i]->name, params[1]) == 0) + for (drv = 0; urj_bus_drivers[drv] != NULL; drv++) + if (strcasecmp (urj_bus_drivers[drv]->name, params[1]) == 0) break; - if (urj_bus_drivers[i] == NULL) + if (urj_bus_drivers[drv] == NULL) { urj_error_set (URJ_ERROR_NOTFOUND, _("Unknown bus: %s"), params[1]); return URJ_STATUS_FAIL; @@ -76,7 +76,7 @@ cmd_initbus_run (urj_chain_t *chain, char *params[]) return URJ_STATUS_FAIL; } - if (urj_bus_init_bus(chain, urj_bus_drivers[i], bus_params) == NULL) + if (urj_bus_init_bus(chain, urj_bus_drivers[drv], bus_params) == NULL) { urj_param_clear (&bus_params); return URJ_STATUS_FAIL;