From ec3e8eb95aec5229b71ee16357a277c83a8e6d4f Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 7 Aug 2022 16:24:59 +0200 Subject: [PATCH] Add size check --- tasmota/tasmota_support/support_wifi.ino | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tasmota/tasmota_support/support_wifi.ino b/tasmota/tasmota_support/support_wifi.ino index 68c9502ea..495fe71b8 100644 --- a/tasmota/tasmota_support/support_wifi.ino +++ b/tasmota/tasmota_support/support_wifi.ino @@ -61,8 +61,8 @@ int WifiGetRssiAsQuality(int rssi) { // 0 1 2 3 4 const char kWifiEncryptionTypes[] PROGMEM = "OPEN|WEP|WPA/PSK|WPA2/PSK|WPA/WPA2/PSK" #ifdef ESP32 -// 5 6 7 8 - "|WPA2ENTERPRISE|WPA3/PSK|WPA2/WPA3/PSK|WAPI/PSK" +// 5 6 7 8 + "|WPA2-Enterprise|WPA3/PSK|WPA2/WPA3/PSK|WAPI/PSK" #endif // ESP32 ; @@ -75,10 +75,11 @@ String WifiEncryptionType(uint32_t i) { // 7 : ENC_TYPE_NONE - open network // 8 : ENC_TYPE_AUTO - WPA / WPA2 / PSK uint8_t typea[] = { 0,2,0,3,1,0,0,4 }; - uint32_t type = typea[WiFi.encryptionType(i) -1 &7]; + int type = typea[WiFi.encryptionType(i) -1 &7]; #else - uint32_t type = WiFi.encryptionType(i); + int type = WiFi.encryptionType(i); #endif + if ((type < 0) || (type > 8)) { type = 0; } char stemp1[20]; GetTextIndexed(stemp1, sizeof(stemp1), type, kWifiEncryptionTypes); return stemp1;