1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-18 23:03:34 +03:00

do check if ssid is an empty String ""

use strdup to save some flash

#386 part 2
This commit is contained in:
Markus Sattler
2015-06-05 12:57:00 +02:00
parent c0df9b0430
commit b620060671
2 changed files with 6 additions and 8 deletions

View File

@ -68,7 +68,7 @@ int ESP8266WiFiClass::begin(const char* ssid, const char *passphrase, int32_t ch
mode(WIFI_STA);
}
if(!ssid || strlen(ssid) > 31) {
if(!ssid || *ssid == 0x00 || strlen(ssid) > 31) {
// fail SSID to long or missing!
return WL_CONNECT_FAILED;
}
@ -154,7 +154,7 @@ void ESP8266WiFiClass::softAP(const char* ssid, const char* passphrase, int chan
mode(WIFI_AP);
}
if(!ssid || strlen(ssid) > 31) {
if(!ssid || *ssid == 0x00 || strlen(ssid) > 31) {
// fail SSID to long or missing!
return;
}