Skip to content

Commit 5ae3e83

Browse files
authored
Fix wrong password same SSID (#5124)
When iterating through APlist from first to the last element, a corrected password for already known SSID is not used. Therefore, I propose to iterate from the back of the list. With iterating from the back through the vector, an already known SSID with a corrected password is used instead.
1 parent eca328e commit 5ae3e83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: libraries/WiFi/src/WiFiMulti.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ uint8_t WiFiMulti::run(uint32_t connectTimeout)
128128
WiFi.getNetworkInfo(i, ssid_scan, sec_scan, rssi_scan, BSSID_scan, chan_scan);
129129

130130
bool known = false;
131-
for(uint32_t x = 0; x < APlist.size(); x++) {
132-
WifiAPlist_t entry = APlist[x];
131+
for(uint32_t x = APlist.size() ; x > 0; x--) {
132+
WifiAPlist_t entry = APlist[x-1];
133133

134134
if(ssid_scan == entry.ssid) { // SSID match
135135
known = true;

0 commit comments

Comments
 (0)