]> The Tcpdump Group git mirrors - libpcap/commit
Address another -Wformat-truncation warning.
authorDenis Ovsienko <[email protected]>
Wed, 18 Jul 2018 14:33:29 +0000 (15:33 +0100)
committerDenis Ovsienko <[email protected]>
Wed, 18 Jul 2018 14:36:50 +0000 (15:36 +0100)
commit44360a51ef60f0dd9be61cd0a4f5a7aff1ffb1c3
tree53bbf6494fc32e4e1a61de5c330602e6ffa995e9
parentf7efd5740a49bd5745c79e9287d14bc2e755c827
Address another -Wformat-truncation warning.

add_dev() does not imply a particular string length for the name and the
description, so it is OK just to increase the buffer size to make the
description fit. While at it, use sizeof() for snprintf() and unsigned
props for the unsigned structure members from <bluetooth/hci.h>.

./pcap-bt-linux.c: In function ‘bt_findalldevs’:
./pcap-bt-linux.c:115:58: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 5 [-Wformat-truncation=]
   pcap_snprintf(dev_descr, 30, "Bluetooth adapter number %d", i);
                                                          ^~
./pcap-bt-linux.c:115:32: note: directive argument in the range [0, 2147483646]
   pcap_snprintf(dev_descr, 30, "Bluetooth adapter number %d", i);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pcap-bt-linux.c