From: Martin Mares Date: Sat, 1 Nov 2014 15:21:49 +0000 (+0100) Subject: Clean up reading of device labels X-Git-Tag: v3.3.0~29 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=73e87e96f42adaf683c66b5cc0b362f9fe1d67b0;p=pciutils.git Clean up reading of device labels --- diff --git a/lib/sysfs.c b/lib/sysfs.c index 3a8a34f..01b5eae 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -161,7 +161,7 @@ sysfs_get_resources(struct pci_dev *d) static void sysfs_scan(struct pci_access *a) { - char dirname[1024]; + char dirname[1024], buf[OBJBUFSIZE]; DIR *dir; struct dirent *entry; int n; @@ -199,7 +199,6 @@ static void sysfs_scan(struct pci_access *a) d->vendor_id = sysfs_get_value(d, "vendor"); d->device_id = sysfs_get_value(d, "device"); d->device_class = sysfs_get_value(d, "class") >> 8; - char buf[1024]; if (sysfs_get_string(d, "label", buf, 0)) d->label = pci_strdup(d->access, buf);