From ac1e153ec04c0c316819e86dc4c42fa172dd2e2c Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 18 Dec 2019 11:54:31 +0100 Subject: [PATCH] Better and smaller AWS fix --- tasmota/settings.ino | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tasmota/settings.ino b/tasmota/settings.ino index 881ec2e7c..bcc182de9 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -590,8 +590,7 @@ char* SettingsText(uint32_t index) case SET_WEBPWD: position = Settings.web_password; break; #if defined(USE_MQTT_TLS) && defined(USE_MQTT_AWS_IOT) case SET_MQTT_HOST: - strncpy(aws_mqtt_host, Settings.mqtt_user, strlen(Settings.mqtt_user)); - strncpy(&aws_mqtt_host[strlen(Settings.mqtt_user)], Settings.mqtt_host, strlen(Settings.mqtt_host)); + snprintf_P(aws_mqtt_host, sizeof(aws_mqtt_host), PSTR("%s%s"), Settings.mqtt_user, Settings.mqtt_host); position = aws_mqtt_host; break; case SET_MQTT_USER: position = aws_mqtt_user; break; #else