diff options
| author | Stefan Eßer <se@FreeBSD.org> | 2016-02-18 15:23:25 +0000 |
|---|---|---|
| committer | Stefan Eßer <se@FreeBSD.org> | 2016-02-18 15:23:25 +0000 |
| commit | a4ed9e4f78048517a2f31aab3c4a425bd609b66a (patch) | |
| tree | 84964f73ff2dcbdea474c4dee504baac7a0ff221 /usr.sbin/pciconf/pciconf.c | |
| parent | 787db28adf2ab740c0627ab4f789a5224bf984ad (diff) | |
Notes
Diffstat (limited to 'usr.sbin/pciconf/pciconf.c')
| -rw-r--r-- | usr.sbin/pciconf/pciconf.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c index 194da6b3d9e81..85b5e870fed77 100644 --- a/usr.sbin/pciconf/pciconf.c +++ b/usr.sbin/pciconf/pciconf.c @@ -67,7 +67,7 @@ struct pci_vendor_info char *desc; }; -TAILQ_HEAD(,pci_vendor_info) pci_vendors; +static TAILQ_HEAD(,pci_vendor_info) pci_vendors; static struct pcisel getsel(const char *str); static void list_bridge(int fd, struct pci_conf *p); @@ -896,16 +896,18 @@ getdevice(const char *name) static struct pcisel parsesel(const char *str) { - char *ep = strchr(str, '@'); - char *epbase; + const char *ep; + const char *epbase; + char *eppos; struct pcisel sel; unsigned long selarr[4]; int i; - if (ep == NULL) - ep = (char *)str; - else + ep = strchr(str, '@'); + if (ep != NULL) ep++; + else + ep = str; epbase = ep; @@ -913,7 +915,8 @@ parsesel(const char *str) ep += 3; i = 0; do { - selarr[i++] = strtoul(ep, &ep, 10); + selarr[i++] = strtoul(ep, &eppos, 10); + ep = eppos; } while ((*ep == ':' || *ep == '.') && *++ep != '\0' && i < 4); if (i > 2) |
