mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2025-08-01 19:24:26 +02:00
Fix crash when creating address from 17 char string.
This commit is contained in:
@@ -54,7 +54,7 @@ NimBLEAddress::NimBLEAddress(const std::string& addr, uint8_t type) {
|
||||
if (addr.length() == 17) {
|
||||
std::string mac{addr};
|
||||
mac.erase(std::remove(mac.begin(), mac.end(), ':'), mac.end());
|
||||
uint64_t address = std::stoul(mac, nullptr, 16);
|
||||
uint64_t address = std::stoull(mac, nullptr, 16);
|
||||
memcpy(this->val, &address, sizeof this->val);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user