aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTom Rini2024-02-07 09:47:47 -0500
committerTom Rini2024-02-07 09:47:47 -0500
commit0101a2ffe125911ebf89172b495f5ff14f2fd058 (patch)
tree212616307e61b5b6e6cab83dfba3a45a2f58c6aa /common
parent7ebc77fede4bb8f1c0b1239c7093d1fa69ccc5a9 (diff)
parente5e7d8bbcffb26f5ac9a8fab7909225f527e157d (diff)
Merge branch '2024-02-06-assorted-fixes'
A number of assorted fixes
Diffstat (limited to 'common')
-rw-r--r--common/event.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/event.c b/common/event.c
index dc61b9672f3..16c2ba6cc92 100644
--- a/common/event.c
+++ b/common/event.c
@@ -56,7 +56,10 @@ _Static_assert(ARRAY_SIZE(type_name) == EVT_COUNT, "event type_name size");
const char *event_type_name(enum event_t type)
{
#if CONFIG_IS_ENABLED(EVENT_DEBUG)
- return type_name[type];
+ if (type < ARRAY_SIZE(type_name))
+ return type_name[type];
+ else
+ return "(unknown)";
#else
return "(unknown)";
#endif