examples/asymcute_mqttsn: fix issues reported coccinelle
no need to cast atoi return value, _topic_init returns a pointer, so check against NULL
This commit is contained in:
parent
38a0a86b1b
commit
212843c080
@ -89,7 +89,7 @@ static uint16_t _parse_predef_id(const char *name)
|
|||||||
{
|
{
|
||||||
uint16_t id = 0;
|
uint16_t id = 0;
|
||||||
if ((strlen(name) > 4) && (strncmp(name, "pre_", 4) == 0)) {
|
if ((strlen(name) > 4) && (strncmp(name, "pre_", 4) == 0)) {
|
||||||
id = (uint16_t)atoi(&name[4]);
|
id = atoi(&name[4]);
|
||||||
}
|
}
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -438,7 +438,7 @@ static int _cmd_sub(int argc, char **argv)
|
|||||||
puts("error: no free topic memory");
|
puts("error: no free topic memory");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (_topic_init(t, argv[1]) == 0) {
|
if (_topic_init(t, argv[1]) == NULL) {
|
||||||
puts("error: unable to initialize topic");
|
puts("error: unable to initialize topic");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user