X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Ffilter.c;h=2bedc95e050a4f168b356747211129e31a3fe4da;hb=f2505ce4aac37067f644646d973eeb382d8db6ec;hp=e66a470e075dc2617edb12b0a281d09e13b2c472;hpb=84c8d1bba90d5f9857b0724ebf6a35045ca3f30f;p=pciutils.git diff --git a/lib/filter.c b/lib/filter.c index e66a470..2bedc95 100644 --- a/lib/filter.c +++ b/lib/filter.c @@ -39,7 +39,7 @@ pci_filter_parse_slot(struct pci_filter *f, char *str) bus = colon2; if (str[0] && strcmp(str, "*")) { - long int x = strtol(bus, &e, 16); + long int x = strtol(str, &e, 16); if ((e && *e) || (x < 0 || x > 0xffff)) return "Invalid domain number"; f->domain = x; @@ -90,14 +90,14 @@ pci_filter_parse_id(struct pci_filter *f, char *str) if (str[0] && strcmp(str, "*")) { long int x = strtol(str, &e, 16); - if ((e && *e) || (x < 0 || x >= 0xffff)) + if ((e && *e) || (x < 0 || x > 0xffff)) return "Invalid vendor ID"; f->vendor = x; } if (s[0] && strcmp(s, "*")) { long int x = strtol(s, &e, 16); - if ((e && *e) || (x < 0 || x >= 0xffff)) + if ((e && *e) || (x < 0 || x > 0xffff)) return "Invalid device ID"; f->device = x; }