diff options
Diffstat (limited to 'pcap-bt-linux.c')
| -rw-r--r-- | pcap-bt-linux.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pcap-bt-linux.c b/pcap-bt-linux.c index 07ed1c73de5a..9c8712e9531a 100644 --- a/pcap-bt-linux.c +++ b/pcap-bt-linux.c @@ -74,13 +74,14 @@ bt_findalldevs(pcap_if_list_t *devlistp, char *err_str) { struct hci_dev_list_req *dev_list; struct hci_dev_req *dev_req; - int i, sock; + int sock; + unsigned i; int ret = 0; sock = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); if (sock < 0) { - /* if bluetooth is not supported this this is not fatal*/ + /* if bluetooth is not supported this is not fatal*/ if (errno == EAFNOSUPPORT) return 0; pcap_fmt_errmsg_for_errno(err_str, PCAP_ERRBUF_SIZE, @@ -109,10 +110,10 @@ bt_findalldevs(pcap_if_list_t *devlistp, char *err_str) dev_req = dev_list->dev_req; for (i = 0; i < dev_list->dev_num; i++, dev_req++) { - char dev_name[20], dev_descr[30]; + char dev_name[20], dev_descr[40]; - pcap_snprintf(dev_name, 20, BT_IFACE"%d", dev_req->dev_id); - pcap_snprintf(dev_descr, 30, "Bluetooth adapter number %d", i); + pcap_snprintf(dev_name, sizeof(dev_name), BT_IFACE"%u", dev_req->dev_id); + pcap_snprintf(dev_descr, sizeof(dev_descr), "Bluetooth adapter number %u", i); /* * Bluetooth is a wireless technology. @@ -379,8 +380,8 @@ bt_read_linux(pcap_t *handle, int max_packets _U_, pcap_handler callback, u_char static int bt_inject_linux(pcap_t *handle, const void *buf _U_, size_t size _U_) { - pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "inject not supported on " - "bluetooth devices"); + pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, + "Packet injection is not supported on Bluetooth devices"); return (-1); } |
