Fix detection of devices on bus numbers larger than 9
authorDebian NVIDIA Maintainers <pkg-nvidia-devel@lists.alioth.debian.org>
Sat, 22 Aug 2020 19:42:31 +0000 (20:42 +0100)
committerPeter Michael Green <plugwash@raspbian.org>
Sat, 22 Aug 2020 19:42:31 +0000 (20:42 +0100)
Origin: upstream, https://github.com/Bumblebee-Project/Bumblebee/commit/2073f8537412aa47755eb6f3f22a114403e5285b
Bug: https://github.com/Bumblebee-Project/Bumblebee/issues/573

Gbp-Pq: Name fix-device-detection.patch

src/bbsecondary.c

index 71a6b73ae57091e7145c9b94b3f347992c45e24e..6b635ee563e7a77a0b7923f1609b97c42efc2bbf 100644 (file)
@@ -138,7 +138,7 @@ bool start_secondary(bool need_secondary) {
   if (!bb_is_running(bb_status.x_pid)) {
     char pci_id[12];
     static char *x_conf_file;
-    snprintf(pci_id, 12, "PCI:%02x:%02x:%o", pci_bus_id_discrete->bus,
+    snprintf(pci_id, 12, "PCI:%02d:%02d:%o", pci_bus_id_discrete->bus,
             pci_bus_id_discrete->slot, pci_bus_id_discrete->func);
     if (!x_conf_file) {
       x_conf_file = xorg_path_w_driver(bb_config.x_conf_file, bb_config.driver);