diff options
author | Bruna Moreira <bruna.moreira@openbossa.org> | 2011-04-27 16:21:03 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2011-04-27 16:25:02 -0700 |
commit | cef88385008d999c515366ebe6c01e3f6967fb61 (patch) | |
tree | ab84b5f5376f241f2a43eabe8e274c3d174722b8 /tools | |
parent | cabcf8599c445acb7bad11ac7c94b5989fd9ac54 (diff) | |
download | bluez-cef88385008d999c515366ebe6c01e3f6967fb61.tar.gz |
Use HCI_MAX_EIR_LENGTH instead of hard-coded value
Diffstat (limited to 'tools')
-rw-r--r-- | tools/hciconfig.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/hciconfig.c b/tools/hciconfig.c index 3db70a418..cbd0d0ee9 100644 --- a/tools/hciconfig.c +++ b/tools/hciconfig.c @@ -1252,7 +1252,7 @@ static void cmd_inq_data(int ctl, int hdev, char *opt) } if (opt) { - uint8_t fec = 0, data[240]; + uint8_t fec = 0, data[HCI_MAX_EIR_LENGTH]; char tmp[3]; int i, size; @@ -1260,8 +1260,8 @@ static void cmd_inq_data(int ctl, int hdev, char *opt) memset(tmp, 0, sizeof(tmp)); size = (strlen(opt) + 1) / 2; - if (size > 240) - size = 240; + if (size > HCI_MAX_EIR_LENGTH) + size = HCI_MAX_EIR_LENGTH; for (i = 0; i < size; i++) { memcpy(tmp, opt + (i * 2), 2); @@ -1274,7 +1274,7 @@ static void cmd_inq_data(int ctl, int hdev, char *opt) exit(1); } } else { - uint8_t fec, data[240], len, type, *ptr; + uint8_t fec, data[HCI_MAX_EIR_LENGTH], len, type, *ptr; char *str; if (hci_read_ext_inquiry_response(dd, &fec, data, 1000) < 0) { @@ -1285,7 +1285,7 @@ static void cmd_inq_data(int ctl, int hdev, char *opt) print_dev_hdr(&di); printf("\tFEC %s\n\t\t", fec ? "enabled" : "disabled"); - for (i = 0; i < 240; i++) + for (i = 0; i < HCI_MAX_EIR_LENGTH; i++) printf("%02x%s%s", data[i], (i + 1) % 8 ? "" : " ", (i + 1) % 16 ? " " : (i < 239 ? "\n\t\t" : "\n")); |