MQTT
Change payload clearing to initialisation instead of using strcpy
This commit is contained in:
@@ -47,7 +47,7 @@ static void mqtt_pub_request_cb(void *arg, err_t result) {
|
||||
*/
|
||||
static void example_publish(mqtt_client_t *client, void *arg) {
|
||||
LOG_INFO(TAG, "Entering publish");
|
||||
char pub_payload[200];
|
||||
char pub_payload[200] = {0};
|
||||
err_t err;
|
||||
u8_t qos = 2;
|
||||
u8_t retain = 1 ;
|
||||
@@ -57,8 +57,6 @@ static void example_publish(mqtt_client_t *client, void *arg) {
|
||||
|
||||
num_files = llfs_file_list(file_list, max_files, "*.bmp");
|
||||
|
||||
strcpy(pub_payload, "\0");
|
||||
|
||||
if(num_files == 0) {
|
||||
strcpy(pub_payload, "No images found");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user