summaryrefslogtreecommitdiff
path: root/usr.sbin/bluetooth
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-04-26 08:31:08 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-04-26 08:31:08 +0000
commit32f32669c3cfd8447f1f28dcc9b1c4d17d651238 (patch)
tree60de6f60030e3a54e678543e07adc2a4f6a51cb2 /usr.sbin/bluetooth
parentba0ced82eab1bd9664aa7304a7daeb6f1d20ab78 (diff)
downloadsrc-test2-32f32669c3cfd8447f1f28dcc9b1c4d17d651238.tar.gz
src-test2-32f32669c3cfd8447f1f28dcc9b1c4d17d651238.zip
Notes
Diffstat (limited to 'usr.sbin/bluetooth')
-rw-r--r--usr.sbin/bluetooth/hccontrol/le.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/bluetooth/hccontrol/le.c b/usr.sbin/bluetooth/hccontrol/le.c
index 9b29b8de8950..fb71f1e20d30 100644
--- a/usr.sbin/bluetooth/hccontrol/le.c
+++ b/usr.sbin/bluetooth/hccontrol/le.c
@@ -172,13 +172,13 @@ parse_param(int argc, char *argv[], char *buf, int *len)
goto done;
curbuf[0] = 2;
curbuf[1] = 1;
- curbuf[2] = atoi(optarg);
+ curbuf[2] = (uint8_t)strtol(optarg, NULL, 16);
curbuf += 3;
break;
case 'u':
- lenpos = buf;
if ((buf+2) >= buflast)
goto done;
+ lenpos = curbuf;
curbuf[1] = 2;
*lenpos = 1;
curbuf += 2;
@@ -189,6 +189,7 @@ parse_param(int argc, char *argv[], char *buf, int *len)
curbuf[0] = value &0xff;
curbuf[1] = (value>>8)&0xff;
curbuf += 2;
+ *lenpos += 2;
}
}