From 7eae03117ef805bc86b07e1ff705c2cc195d7964 Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Fri, 15 Dec 2023 21:21:06 -0500 Subject: [PATCH] fix: fall-through to default cursor in cursor_get_from_edge() When assertions are disabled, providing an unexpected input to cursor_get_from_edge will cause the non-void function to terminate without a return value. This may be effectively unreachable in practice. However, returning a default cursor as a fall-through case will both silence a compiler warning and prevent catastrophy should the function ever be called with a permitted value. --- src/input/cursor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/input/cursor.c b/src/input/cursor.c index cb3f67bc..22680461 100644 --- a/src/input/cursor.c +++ b/src/input/cursor.c @@ -91,6 +91,8 @@ cursor_get_from_edge(uint32_t resize_edges) "Failed to resolve wlroots edge %u to cursor name", resize_edges); assert(false); } + + return LAB_CURSOR_DEFAULT; } static enum lab_cursors