diff --git a/.gitignore b/.gitignore index 8800167..a108ad5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ build tags -.vscode # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a diff --git a/src/mqttcm_connect.c b/src/mqttcm_connect.c index 054c92e..a670f5d 100644 --- a/src/mqttcm_connect.c +++ b/src/mqttcm_connect.c @@ -1718,7 +1718,7 @@ int mqtt_subscribe(char *comp, char *topic) if(strcmp (comp, SUBSCRIBE_WEBCONFIG) == 0) { int subscribeId; - sprintf(temp_topic,"%s%s/#",MQTT_SUBSCRIBE_TOPIC,Get_Mqtt_ClientId()); + snprintf(temp_topic, sizeof(temp_topic), "%s%s/#", MQTT_SUBSCRIBE_TOPIC, Get_Mqtt_ClientId()); MqttCMInfo("Subscribing to wildcard topic - %s\n", temp_topic); rc = mosquitto_subscribe(mosq, &subscribeId, temp_topic, 1);