mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
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 <mpacuraru@protonmail.com>
This commit is contained in:
parent
e4b84b29d4
commit
c46ed184ed
1 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue