Skip to content

Commit 4684e44

Browse files
committed
Re-enable old behaviour if passphrase string is empty
An empty passphrase string should enable AUTH_OPEN mode of softAP. This was the behaviour before commit 293e55c. Additionally make the type of checking for empty strings consistent.
1 parent 2301f29 commit 4684e44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ bool ESP8266WiFiAPClass::softAP(const char* ssid, const char* passphrase, int ch
8989
return false;
9090
}
9191

92-
if(!ssid || *ssid == 0 || strlen(ssid) > 31) {
92+
if(!ssid || strlen(ssid) == 0 || strlen(ssid) > 31) {
9393
// fail SSID too long or missing!
9494
DEBUG_WIFI("[AP] SSID too long or missing!\n");
9595
return false;
9696
}
9797

98-
if(passphrase && (strlen(passphrase) > 63 || strlen(passphrase) < 8)) {
98+
if(passphrase && strlen(passphrase) > 0 && (strlen(passphrase) > 63 || strlen(passphrase) < 8)) {
9999
// fail passphrase to long or short!
100100
DEBUG_WIFI("[AP] fail passphrase to long or short!\n");
101101
return false;

0 commit comments

Comments
 (0)