mirror of
https://github.com/openbsd/src.git
synced 2024-12-22 16:42:56 -08:00
fix an off by one
ok kettenis@
This commit is contained in:
parent
4d572b0ba1
commit
6bdb5af846
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user