]> mj.ucw.cz Git - pciutils.git/commitdiff
Let filters accept vendor and device 0xffff.
authorMartin Mares <mj@ucw.cz>
Tue, 26 Aug 2008 11:24:35 +0000 (13:24 +0200)
committerMartin Mares <mj@ucw.cz>
Tue, 26 Aug 2008 11:24:35 +0000 (13:24 +0200)
Thanks to Sebastian Herbszt for a bug report.

lib/filter.c

index eb375c49022d4e3e7b347befda47de3e0a318b08..2bedc95e050a4f168b356747211129e31a3fe4da 100644 (file)
@@ -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;
     }