summaryrefslogtreecommitdiffstats
path: root/simulator
diff options
context:
space:
mode:
authorJesse Michael <wrffrz@gmail.com>2020-01-20 12:46:22 -0800
committerEvan Lojewski <github@meklort.com>2020-01-20 13:46:22 -0700
commit550345e5f6bb536770b5d712182eb6db73f83ea1 (patch)
treed8ddcf598033afc032152503fda0e4ae9ed62770 /simulator
parent6bdc89944780f0affcf5d1173a6dd8e6e33fb6bd (diff)
downloadbcm5719-ortega-550345e5f6bb536770b5d712182eb6db73f83ea1.tar.gz
bcm5719-ortega-550345e5f6bb536770b5d712182eb6db73f83ea1.zip
Fix format string for parsing /sys/bus/pci/devices/ entries (#13)
Diffstat (limited to 'simulator')
-rw-r--r--simulator/HAL.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/simulator/HAL.cpp b/simulator/HAL.cpp
index 2342840..e6febb7 100644
--- a/simulator/HAL.cpp
+++ b/simulator/HAL.cpp
@@ -142,7 +142,7 @@ bool is_pci_function(const char *pci_path, int wanted_function)
int bus = 0;
int slot = 0;
int function = 0;
- if (4 == sscanf(pci_path, "%d:%d:%d.%d\n", &sys, &bus, &slot, &function))
+ if (4 == sscanf(pci_path, "%x:%x:%x.%d\n", &sys, &bus, &slot, &function))
{
if (wanted_function == function)
{
@@ -223,6 +223,7 @@ bool initHAL(const char *pci_path, int wanted_function)
pci_path = located_pci_path;
if(!located_pci_path)
{
+ fprintf(stderr, "Unable to find supported PCI device\n");
return false;
}
}
OpenPOWER on IntegriCloud