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;