From 697e6b5c228c2076e034bc45bdc11835f54fdcd1 Mon Sep 17 00:00:00 2001 From: mr-sven Date: Wed, 25 Apr 2018 21:00:40 +0200 Subject: [PATCH] Changed argument getter with sizeof --- mqtt/mqtt_cmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mqtt/mqtt_cmd.c b/mqtt/mqtt_cmd.c index b6bb909..a1b944c 100644 --- a/mqtt/mqtt_cmd.c +++ b/mqtt/mqtt_cmd.c @@ -93,10 +93,10 @@ MQTTCMD_Lwt(CmdPacket *cmd) { client->connect_info.will_message[len] = 0; // get qos - cmdPopArg(&req, (uint8_t*)&client->connect_info.will_qos, 4); + cmdPopArg(&req, (uint8_t*)&client->connect_info.will_qos, sizeof(client->connect_info.will_qos)); // get retain - cmdPopArg(&req, (uint8_t*)&client->connect_info.will_retain, 4); + cmdPopArg(&req, (uint8_t*)&client->connect_info.will_retain, sizeof(client->connect_info.will_retain)); DBG("MQTT: MQTTCMD_Lwt topic=%s, message=%s, qos=%d, retain=%d\n", client->connect_info.will_topic, @@ -177,7 +177,7 @@ MQTTCMD_Subscribe(CmdPacket *cmd) { // get qos uint32_t qos = 0; - cmdPopArg(&req, (uint8_t*)&qos, 4); + cmdPopArg(&req, (uint8_t*)&qos, sizeof(qos)); DBG("MQTT: MQTTCMD_Subscribe topic=%s, qos=%u\n", topic, qos);