forked from h2zero/esp-nimble-cpp
Fix crash when creating address from 17 char string.
This commit is contained in:
1 parent
d22db6ef8c
commit
12074d1cc4
1 file changed
+1
-1
@@ -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