diff options
author | Jesse Michael <wrffrz@gmail.com> | 2020-01-20 12:46:22 -0800 |
---|---|---|
committer | Evan Lojewski <github@meklort.com> | 2020-01-20 13:46:22 -0700 |
commit | 550345e5f6bb536770b5d712182eb6db73f83ea1 (patch) | |
tree | d8ddcf598033afc032152503fda0e4ae9ed62770 /simulator/HAL.cpp | |
parent | 6bdc89944780f0affcf5d1173a6dd8e6e33fb6bd (diff) | |
download | bcm5719-ortega-550345e5f6bb536770b5d712182eb6db73f83ea1.tar.gz bcm5719-ortega-550345e5f6bb536770b5d712182eb6db73f83ea1.zip |
Fix format string for parsing /sys/bus/pci/devices/ entries (#13)
Diffstat (limited to 'simulator/HAL.cpp')
-rw-r--r-- | simulator/HAL.cpp | 3 |
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; } } |