Fix AWS mqtt host length clipped to 32

This commit is contained in:
Theo Arends 2019-12-18 11:41:10 +01:00
parent 5e9f33a124
commit 46aec3acf5
1 changed files with 2 additions and 2 deletions

View File

@ -590,8 +590,8 @@ 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:
strlcpy(aws_mqtt_host, Settings.mqtt_user, strlen(Settings.mqtt_user));
strlcpy(&aws_mqtt_host[strlen(Settings.mqtt_user)], Settings.mqtt_host, sizeof(Settings.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));
position = aws_mqtt_host; break;
case SET_MQTT_USER: position = aws_mqtt_user; break;
#else