Fix possible string overflow in BTAdvertisedDeviceSet::toString()

This commit is contained in:
me-no-dev 2021-04-16 18:51:01 +03:00
parent 41c372c143
commit 57cf2fb9f5

View File

@ -47,8 +47,8 @@ std::string BTAdvertisedDeviceSet::toString() {
res += val;
}
if (haveRSSI()) {
char val[4];
snprintf(val, sizeof(val), "%d", getRSSI());
char val[6];
snprintf(val, sizeof(val), "%d", (int8_t)getRSSI());
res += ", rssi: ";
res += val;
}