mirror of https://gerrit.osmocom.org/libosmocore
control_cmd.c: Fix unsiged comparison against < 0
Fixes following warning: control_cmd.c:294:16: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare] if (cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) { Change-Id: I3df8a4f646222337927d9e3cac6d09a8a05cb20c
This commit is contained in:
parent
c8ebc326b2
commit
c1122f17d6
|
@ -291,7 +291,7 @@ struct ctrl_cmd *ctrl_cmd_parse(void *ctx, struct msgb *msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd->type = get_string_value(ctrl_type_vals, tmp);
|
cmd->type = get_string_value(ctrl_type_vals, tmp);
|
||||||
if (cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) {
|
if ((int)cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) {
|
||||||
cmd->type = CTRL_TYPE_ERROR;
|
cmd->type = CTRL_TYPE_ERROR;
|
||||||
cmd->id = "err";
|
cmd->id = "err";
|
||||||
cmd->reply = "Request type unknown";
|
cmd->reply = "Request type unknown";
|
||||||
|
|
Loading…
Reference in New Issue