summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-01-10 15:14:53 +0000
committerThierry Vignaud <tv@mandriva.org>2007-01-10 15:14:53 +0000
commit2a61aeea75229093d004d6bb2684418a11690d27 (patch)
treea3c720612c200d5f08c0ba2ac5e48386f102b17f
parentd91563b881fc517e5a99b4c32398a1c07a94a7fe (diff)
downloadldetect-2a61aeea75229093d004d6bb2684418a11690d27.tar
ldetect-2a61aeea75229093d004d6bb2684418a11690d27.tar.gz
ldetect-2a61aeea75229093d004d6bb2684418a11690d27.tar.bz2
ldetect-2a61aeea75229093d004d6bb2684418a11690d27.tar.xz
ldetect-2a61aeea75229093d004d6bb2684418a11690d27.zip
(usb_probe) fix parsing /proc/bus/usb/devices with kernel-2.6.20
(eg: "I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage")
-rw-r--r--usb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usb.c b/usb.c
index 4494395..7d45563 100644
--- a/usb.c
+++ b/usb.c
@@ -59,7 +59,7 @@ extern struct pciusb_entries usb_probe(void) {
case 'I': if (e->class_ == 0) {
char driver[50];
int class_, sub, prot = 0;
- if (sscanf(buf, "I: If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=%s", &class_, &sub, &prot, driver) == 4) {
+ if (sscanf(buf, "I:%*1c If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=%s", &class_, &sub, &prot, driver) == 4) {
e->class_ = (class_ * 0x100 + sub) * 0x100 + prot;
if (strncmp(driver, "(none)", 6))
e->module = strdup(driver);
@@ -67,7 +67,7 @@ extern struct pciusb_entries usb_probe(void) {
if (e->class_ == (0x1*0x100+ 0x01)) /* USB_AUDIO_CLASS*0x100 + USB_SUBCLASS_AUDIO_CONTROL*/
e->module = strdup("snd-usb-audio");
- } else if (sscanf(buf, "I: If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=", &class_, &sub, &prot) == 3) {
+ } else if (sscanf(buf, "I:%*1c If#=%*2d Alt=%*2d #EPs=%*2d Cls=%02x(%*5c) Sub=%02x Prot=%02x Driver=", &class_, &sub, &prot) == 3) {
/* prevent spurious warnings for strange USB interfaces */
} else fprintf(stderr, "%s %d: unknown ``I'' line\n", proc_usb_path, line);
break;