This is an automated email from the ASF dual-hosted git repository.

simbit18 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit c46ed184edceea1a2d4c63ed428aeeefb066b9c4
Author: Mihai Pacuraru <[email protected]>
AuthorDate: Sat Feb 28 11:43:31 2026 +0200

    examples/mqttc: Fix QOS arguments parsing (char->long).
    
    Modify the switch cases in parsearg function for QOS levels definition.
    The comparison was made between a long value and a char.
    
    Signed-off-by: Mihai Pacuraru <[email protected]>
---
 examples/mqttc/mqttc_pub.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/mqttc/mqttc_pub.c b/examples/mqttc/mqttc_pub.c
index 6948afb42..9beae6885 100644
--- a/examples/mqttc/mqttc_pub.c
+++ b/examples/mqttc/mqttc_pub.c
@@ -192,13 +192,13 @@ static void parsearg(int argc, FAR char *argv[],
           case 'q':
             switch (strtol(optarg, NULL, 10))
               {
-                case '0':
+                case 0L:
                   cfg->qos = MQTT_PUBLISH_QOS_0;
                   break;
-                case '1':
+                case 1L:
                   cfg->qos = MQTT_PUBLISH_QOS_1;
                   break;
-                case '2':
+                case 2L:
                   cfg->qos = MQTT_PUBLISH_QOS_2;
                   break;
                 }

Reply via email to