diff --git a/ui/qt/bluetooth_device_dialog.cpp b/ui/qt/bluetooth_device_dialog.cpp index 77c4c98328..47435dfba6 100644 --- a/ui/qt/bluetooth_device_dialog.cpp +++ b/ui/qt/bluetooth_device_dialog.cpp @@ -395,9 +395,10 @@ tap_packet_status BluetoothDeviceDialog::tapPacket(void *tapinfo_ptr, packet_inf } if (tap_device->has_bd_addr) { - for (int i = 0; i < 6; ++i) - bd_addr += QString("%1:").arg(tap_device->bd_addr[0], 2, 16, QChar('0')); - bd_addr.remove(bd_addr.length() - 1, 1); + for (int i = 0; i < 6; ++i) { + bd_addr += QString("%1:").arg(tap_device->bd_addr[i], 2, 16, QChar('0')); + } + bd_addr.chop(1); // remove extra character ":" from the end of the string if (!tap_device->is_local && bd_addr != tapinfo->bdAddr) return TAP_PACKET_REDRAW; diff --git a/ui/qt/bluetooth_devices_dialog.cpp b/ui/qt/bluetooth_devices_dialog.cpp index d8b556da67..09364f8e70 100644 --- a/ui/qt/bluetooth_devices_dialog.cpp +++ b/ui/qt/bluetooth_devices_dialog.cpp @@ -286,10 +286,10 @@ tap_packet_status BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_in } if (tap_device->has_bd_addr) { - for (int i = 0; i < 6; ++i) - bd_addr += QString("%1:").arg(tap_device->bd_addr[0], 2, 16, QChar('0')); - bd_addr.remove(bd_addr.length() - 1, 1); - + for (int i = 0; i < 6; ++i) { + bd_addr += QString("%1:").arg(tap_device->bd_addr[i], 2, 16, QChar('0')); + } + bd_addr.chop(1); // remove extra character ":" from the end of the string manuf = get_ether_name(tap_device->bd_addr); if (manuf) { int pos;