]> git.mdlowis.com Git - proto/labwc.git/commitdiff
fix: fall-through to default cursor in cursor_get_from_edge()
authorAndrew J. Hesford <ajh@sideband.org>
Sat, 16 Dec 2023 02:21:06 +0000 (21:21 -0500)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sat, 16 Dec 2023 20:11:05 +0000 (20:11 +0000)
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

index cb3f67bc0c64e5a5188437ff8f9b9a23ef44e0c6..22680461f0a5f7685000bbc317b339059c84db33 100644 (file)
@@ -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