Fixed bug in mqtt_iot_explorer_e53_light.c

This commit is contained in:
David Lin
2020-12-31 17:49:06 +08:00
committed by GitHub
parent 1f510c6da6
commit f47c328e23

View File

@@ -214,7 +214,7 @@ static void mqtt_demo_task(void)
printf("module mqtt sub success\n");
}
memset(report_topic_name, sizeof(report_topic_name), 0);
memset(report_topic_name, 0, sizeof(report_topic_name));
size = snprintf(report_topic_name, TOPIC_NAME_MAX_SIZE, "$thing/up/property/%s/%s", product_id, device_name);
if (size < 0 || size > sizeof(report_topic_name) - 1) {
printf("pub topic content length not enough! content size:%d buf size:%d", size, (int)sizeof(report_topic_name));