aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2022-08-30 19:19:47 +0300
committerKirill Primak <vyivel@eclair.cafe>2022-08-30 19:26:23 +0300
commit2ea80eb115a74ed2047fc19914f0c04f18bb7e5e (patch)
tree5468cec45732c1df529ca09a5d7c28d1a2a99191
parent4462f5dcb38b8b4ddc4c1eb888aa0d0c859a10a1 (diff)
output-layout: avoid uninitialized wlr_box fields
-rw-r--r--types/wlr_output_layout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/types/wlr_output_layout.c b/types/wlr_output_layout.c
index 319b7cf7..275f87d7 100644
--- a/types/wlr_output_layout.c
+++ b/types/wlr_output_layout.c
@@ -365,6 +365,8 @@ void wlr_output_layout_closest_point(struct wlr_output_layout *layout,
void wlr_output_layout_get_box(struct wlr_output_layout *layout,
struct wlr_output *reference, struct wlr_box *dest_box) {
+ memset(dest_box, 0, sizeof(*dest_box));
+
struct wlr_output_layout_output *l_output;
if (reference) {
// output extents
@@ -372,8 +374,6 @@ void wlr_output_layout_get_box(struct wlr_output_layout *layout,
if (l_output) {
output_layout_output_get_box(l_output, dest_box);
- } else {
- dest_box->width = dest_box->height = 0;
}
} else {
// layout extents