Avoid buffer overflow

This commit is contained in:
Charles 2018-04-04 14:27:36 +02:00
parent 204b91237c
commit 334a23a8e2

View File

@ -70,7 +70,7 @@ bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type) {
}
if (added) { // first time seen this WIFI or BLE MAC
snprintf(counter, sizeof(counter), "%d", (int) macs.size()); // convert 16-bit MAC counter to decimal counter value
snprintf(counter, sizeof(counter), "%d", (uint16_t) macs.size()); // convert 16-bit MAC counter to decimal counter value
u8x8.draw2x2String(0, 0, counter); // display number on unique macs total Wifi + BLE
ESP_LOGI(TAG, "%s RSSI %d -> Hash %04X -> WiFi:%d BLE:%d Tot:%d",
typebuff, rssi, hashedmac,