diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2011-01-13 14:17:22 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2011-01-13 14:17:22 +0000 |
commit | f3ec113ea2bbeec535a87a16510a6473bc2b05a5 (patch) | |
tree | c23b3a08fd2921369c2436cc7664e16c24170901 | |
parent | 352ec5378af29661e55729ff05d8b5cc50274936 (diff) |
fix an off by one
ok kettenis@
-rw-r--r-- | usr.sbin/pcidump/pcidump.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/pcidump/pcidump.c b/usr.sbin/pcidump/pcidump.c index bcfab605e80..4407f96caac 100644 --- a/usr.sbin/pcidump/pcidump.c +++ b/usr.sbin/pcidump/pcidump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcidump.c,v 1.27 2011/01/12 20:17:56 kettenis Exp $ */ +/* $OpenBSD: pcidump.c,v 1.28 2011/01/13 14:17:21 jsg Exp $ */ /* * Copyright (c) 2006, 2007 David Gwynne <loki@animata.net> @@ -341,7 +341,7 @@ dump_caplist(int bus, int dev, int func, u_int8_t ptr) return; cap = PCI_CAPLIST_CAP(reg); printf("\t0x%04x: Capability 0x%02x: ", ptr, cap); - if (cap > nitems(pci_capnames)) + if (cap >= nitems(pci_capnames)) cap = 0; printf("%s\n", pci_capnames[cap]); if (cap == PCI_CAP_PCIEXPRESS) |