summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2011-01-13 14:17:22 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2011-01-13 14:17:22 +0000
commitf3ec113ea2bbeec535a87a16510a6473bc2b05a5 (patch)
treec23b3a08fd2921369c2436cc7664e16c24170901 /usr.sbin
parent352ec5378af29661e55729ff05d8b5cc50274936 (diff)
fix an off by one
ok kettenis@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pcidump/pcidump.c4
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)