diff --git a/main/event.c b/main/event.c index 5796aab190..94365e26a3 100644 --- a/main/event.c +++ b/main/event.c @@ -295,7 +295,7 @@ const char *ast_event_get_type_name(const struct ast_event *event) type = ast_event_get_type(event); - if (type >= ARRAY_LEN(event_names)) { + if ((unsigned int)type >= ARRAY_LEN(event_names)) { ast_log(LOG_ERROR, "Invalid event type - '%u'\n", type); return ""; } diff --git a/main/security_events.c b/main/security_events.c index ca24921bac..cb8959017a 100644 --- a/main/security_events.c +++ b/main/security_events.c @@ -427,7 +427,7 @@ const char *ast_security_event_severity_get_name( static int check_event_type(const enum ast_security_event_type event_type) { - if (event_type >= AST_SECURITY_EVENT_NUM_TYPES) { + if ((unsigned int)event_type >= AST_SECURITY_EVENT_NUM_TYPES) { ast_log(LOG_ERROR, "Invalid security event type %u\n", event_type); return -1; } @@ -680,7 +680,7 @@ int ast_security_event_report(const struct ast_security_event_common *sec) { int res; - if (sec->event_type >= AST_SECURITY_EVENT_NUM_TYPES) { + if ((unsigned int)sec->event_type >= AST_SECURITY_EVENT_NUM_TYPES) { ast_log(LOG_ERROR, "Invalid security event type\n"); return -1; }