Skip to content

Commit

Permalink
Fix WiFi scan issue (esp8266#1355)
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Feb 3, 2016
1 parent aa0c14c commit 1d14956
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/ESP8266WiFi/src/ESP8266WiFiScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,17 +281,17 @@ void ESP8266WiFiScanClass::_scanDone(void* result, int status) {
} else {

int i = 0;
bss_info_head_t* head = reinterpret_cast<bss_info_head_t*>(result);
bss_info* head = reinterpret_cast<bss_info*>(result);

for(bss_info* it = STAILQ_FIRST(head); it; it = STAILQ_NEXT(it, next), ++i)
for(bss_info* it = head; it; it = STAILQ_NEXT(it, next), ++i)
;
ESP8266WiFiScanClass::_scanCount = i;
if(i == 0) {
ESP8266WiFiScanClass::_scanResult = 0;
} else {
bss_info* copied_info = new bss_info[i];
i = 0;
for(bss_info* it = STAILQ_FIRST(head); it; it = STAILQ_NEXT(it, next), ++i) {
for(bss_info* it = head; it; it = STAILQ_NEXT(it, next), ++i) {
memcpy(copied_info + i, it, sizeof(bss_info));
}

Expand Down

0 comments on commit 1d14956

Please sign in to comment.