summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Krasnyansky <maxk@qualcomm.com>2002-06-18 18:33:43 +0000
committerMax Krasnyansky <maxk@qualcomm.com>2002-06-18 18:33:43 +0000
commit002edf82ee25e3161bb00e6c976aefcb11062ba1 (patch)
tree0c3421d4d44cb63292af9e6c8349c37701c9fe25
parent8ee2371d4b948a541a71fce00e1cfde01ed364d8 (diff)
use hci_devid
-rw-r--r--tools/hcitool.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/hcitool.c b/tools/hcitool.c
index c2ad6186..96348342 100644
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -980,7 +980,11 @@ int main(int argc, char **argv)
while ((opt=getopt_long(argc, argv, "+i:h", main_options, NULL)) != -1) {
switch(opt) {
case 'i':
- dev_id = atoi(optarg + 3);
+ dev_id = hci_devid(optarg);
+ if (dev_id < 0) {
+ perror("Invalid device");
+ exit(1);
+ }
break;
case 'h':