use stored d->num, in search for devices

This commit is contained in:
Alexandre Ratchov 2015-11-25 20:48:47 +01:00
parent a17c9dfc55
commit d4cea96993
1 changed files with 1 additions and 1 deletions

View File

@ -1226,7 +1226,7 @@ dev_bynum(int num)
struct dev *d;
for (d = dev_list; d != NULL; d = d->next) {
if (num-- == 0)
if (d->num == num)
return d;
}
return NULL;