%4x sometimes introduces spaces; this should use %04hx for root_domain
and %02hhx for root_bus everywhere.
Resolves github issue #83.
Signed-off-by: Peter Jones <pjones@redhat.com>
uint8_t *fbuf = NULL;
rc = read_sysfs_file(&fbuf,
- "/sys/devices/pci%04x:%02x/firmware_node/hid",
+ "/sys/devices/pci%04hx:%02hhx/firmware_node/hid",
root_domain, root_bus);
if (rc < 0 || fbuf == NULL)
return -1;
fbuf = NULL;
int use_uid_str = 0;
rc = read_sysfs_file(&fbuf,
- "/sys/devices/pci%4x:%02x/firmware_node/uid",
+ "/sys/devices/pci%04hx:%02hhx/firmware_node/uid",
root_domain, root_bus);
if ((rc <= 0 && errno != ENOENT) || fbuf == NULL)
return -1;