aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-05-20 17:12:36 -0400
committerKirill Primak <vyivel@eclair.cafe>2023-05-23 17:57:16 +0000
commitacaf57dcca9a10e469f92620a145c040224b2384 (patch)
tree152188347dcbb2a440ef6f19e101cff01bd44869
parentd7bebb0a4c029dd0e3033dc391b39a93f71378f5 (diff)
wlr_{box, fbox}_equal: Handle NULL
-rw-r--r--util/box.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/box.c b/util/box.c
index d7d22617..48bfbfdd 100644
--- a/util/box.c
+++ b/util/box.c
@@ -175,11 +175,19 @@ void wlr_fbox_transform(struct wlr_fbox *dest, const struct wlr_fbox *box,
#ifdef WLR_USE_UNSTABLE
bool wlr_box_equal(const struct wlr_box *a, const struct wlr_box *b) {
+ if (a == NULL || b == NULL) {
+ return a == b;
+ }
+
return a->x == b->x && a->y == b->y &&
a->width == b->width && a->height == b->height;
}
bool wlr_fbox_equal(const struct wlr_fbox *a, const struct wlr_fbox *b) {
+ if (a == NULL || b == NULL) {
+ return a == b;
+ }
+
return a->x == b->x && a->y == b->y &&
a->width == b->width && a->height == b->height;
}