summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)