From 8aa85bd31abadedf69947250188795fad598dedd Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 23 Jun 2017 12:43:31 +0200 Subject: control_cmd.c: Fix unsigned 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 --- src/ctrl/control_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index 836bb717..24b388b3 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -291,7 +291,7 @@ struct ctrl_cmd *ctrl_cmd_parse(void *ctx, struct msgb *msg) } 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->id = "err"; cmd->reply = "Request type unknown"; -- cgit v1.2.3