diff --git a/src/main.cpp b/src/main.cpp index bc2250c..12a37d1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -399,7 +399,7 @@ static void factoryReset(bool clearWifi) { Serial.printf("[BOOT] factory reset triggered (clearWifi=%d)!\n", clearWifi); strlcpy(hostname, HOSTNAME_DEFAULT, sizeof(hostname)); - hostnameParam.setValue(hostname, strlen(hostname)); + hostnameParam.setValue(hostname, sizeof(hostname) - 1); authCfg.enabled = false; authCfg.pass[0] = '\0'; @@ -455,7 +455,7 @@ void setup() { LittleFS.begin(true); loadConfig(); - hostnameParam.setValue(hostname, strlen(hostname)); + hostnameParam.setValue(hostname, sizeof(hostname) - 1); int resetCount = incrementResetCount();