X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ls-tree.c;h=cc65ac472097b36d93100e7ba6821ebf873fecfd;hb=4c2b4b1bfa348ea22a22f4ca271bc13096ab3e78;hp=f8154a2b034a67a3b22dd4eb2e5da82d542256d2;hpb=fd9c6a29a32659287cb7be52b2f2ca638cda35ad;p=pciutils.git diff --git a/ls-tree.c b/ls-tree.c index f8154a2..cc65ac4 100644 --- a/ls-tree.c +++ b/ls-tree.c @@ -107,7 +107,7 @@ grow_tree(void) { struct pci_dev *dd = d->dev; word class = dd->device_class; - byte ht = get_conf_byte(d, PCI_HEADER_TYPE) & 0x7f; + byte ht = d->no_config_access ? -1 : (get_conf_byte(d, PCI_HEADER_TYPE) & 0x7f); if ((class >> 8) == PCI_BASE_CLASS_BRIDGE && (ht == PCI_HEADER_TYPE_BRIDGE || ht == PCI_HEADER_TYPE_CARDBUS)) { @@ -239,7 +239,11 @@ tree_printf(char *line, char *p, char *fmt, ...) p += space; } else if (res >= space) - p += space; + { + /* Ancient C libraries do not truncate the output properly. */ + *(p+space-1) = 0; + p += space; + } else p += res;