From 8655f986acb563f1d01508c75ca93289bd963714 Mon Sep 17 00:00:00 2001 From: Morgan Allen Date: Fri, 21 Sep 2018 21:32:23 -0700 Subject: [PATCH] if last is not initd when an AP is added, set to 0 --- main/esp32-wifi-manager.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main/esp32-wifi-manager.c b/main/esp32-wifi-manager.c index 79c9b61..86e802e 100644 --- a/main/esp32-wifi-manager.c +++ b/main/esp32-wifi-manager.c @@ -83,6 +83,9 @@ uint8_t wifi_manager_add_ap(char *ssid, char *password) { ++ap_store.count; + if(ap_store.last == -1) + ap_store.last = 0; + wifi_manager_save_config(); return ap_store.count;