mc.mitm: reverse bluetooth address using temporary var of correct size to keep compiler happy

This commit is contained in:
ndeadly 2022-05-30 22:36:00 +02:00
parent 6268edb113
commit 4f5cb51c1e

View file

@ -34,7 +34,9 @@ namespace ams::bluetooth::core {
os::Event g_data_read_event(os::EventClearMode_AutoClear); os::Event g_data_read_event(os::EventClearMode_AutoClear);
bluetooth::Address ReverseBluetoothAddress(bluetooth::Address address) { bluetooth::Address ReverseBluetoothAddress(bluetooth::Address address) {
uint64_t tmp = util::SwapEndian48(*reinterpret_cast<uint64_t *>(&address)); uint64_t tmp;
std::memcpy(&tmp, &address, sizeof(address));
tmp = util::SwapEndian(tmp) >> 16;
return *reinterpret_cast<bluetooth::Address *>(&tmp); return *reinterpret_cast<bluetooth::Address *>(&tmp);
} }