diff --git a/src/espmega_iot_core.cpp b/src/espmega_iot_core.cpp index 50e1bd4..b1d9ae8 100644 --- a/src/espmega_iot_core.cpp +++ b/src/espmega_iot_core.cpp @@ -458,9 +458,9 @@ void ota_begin() if(!value.compareTo("yes")) use_auth = true; } else if(!arg.compareTo("webui_username")) { - ESPMega_FRAM.write(EEPROM_ADDRESS_WEBUI_USERNAME, (uint8_t *)value.c_str(), value.length()); + ESPMega_FRAM.write(EEPROM_ADDRESS_WEBUI_USERNAME, (uint8_t *)value.c_str(), value.length()+1); } else if(!arg.compareTo("webui_password")) { - ESPMega_FRAM.write(EEPROM_ADDRESS_WEBUI_PASSWORD, (uint8_t *)value.c_str(), value.length()); + ESPMega_FRAM.write(EEPROM_ADDRESS_WEBUI_PASSWORD, (uint8_t *)value.c_str(), value.length()+1); } } set_mqtt_useauth(use_auth);