use separate index variable for driver selection

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1641 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 16 years ago
parent be14802d6a
commit 2d6c042179

@ -1,3 +1,7 @@
2009-06-02 Arnim Laeuger <arniml>
* src/cmd/cmd_initbus.c: use separate index variable for driver selection
2009-06-01 Arnim Laeuger <arniml>
* src/bsdl/bsdl_sem.c, THANKS: Fix bsdl bit order and safe bit

@ -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;

Loading…
Cancel
Save