summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2002-07-16 15:28:10 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2002-07-16 15:28:10 +0000
commit3f6174dc0fcbfbd9a8e66220e6f166180eb4302c (patch)
treed7678a1907a35ec64c6f30df60a325d82e972350
parent2e14e5ad5bdf326a6b8b6e3064ca04e07fbd086c (diff)
downloadldetect-3f6174dc0fcbfbd9a8e66220e6f166180eb4302c.tar
ldetect-3f6174dc0fcbfbd9a8e66220e6f166180eb4302c.tar.gz
ldetect-3f6174dc0fcbfbd9a8e66220e6f166180eb4302c.tar.bz2
ldetect-3f6174dc0fcbfbd9a8e66220e6f166180eb4302c.tar.xz
ldetect-3f6174dc0fcbfbd9a8e66220e6f166180eb4302c.zip
- fix usb "url"
- prevent potential segfault if no argument to -u in next test
-rw-r--r--lspcidrake.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lspcidrake.c b/lspcidrake.c
index f98bed3..62dd2f5 100644
--- a/lspcidrake.c
+++ b/lspcidrake.c
@@ -39,7 +39,7 @@ int main(int argc, char **argv) {
printf("usage: lspcidrake [-v|-f|-u]\n"
"-f : full probe\n"
"-p : pci devices source [/proc/bus/pci/devices by default\n"
- "-u : usb devices source [/proc/usb/devices by default\n"
+ "-u : usb devices source [/proc/bus/usb/devices by default\n"
"-v : verbose mode [print ids and sub-ids], implies full probe\n"
);
return 0;
@@ -50,8 +50,10 @@ int main(int argc, char **argv) {
}
if (!strcmp(*ptr, "-f"))
full_probe = 1;
- if (!strcmp(*ptr, "-u"))
+ if (!strcmp(*ptr, "-u")) {
proc_usb_path = *++ptr;
+ continue;
+ }
if (!strcmp(*ptr, "-p"))
proc_pci_path = *++ptr;
ptr++;