aboutsummaryrefslogtreecommitdiff
path: root/xwayland/selection
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-04-26 09:43:54 +0200
committerSimon Ser <contact@emersion.fr>2022-04-28 10:09:50 +0200
commit6c350799b22ddc5cb89467c95692437bbf0116b9 (patch)
tree4559c68cb117d9c044e79fb0fbb7453042538375 /xwayland/selection
parent54653b5d95935e379e26db5518456a66384b5405 (diff)
Zero-initialize structs in init functions
Ensures there is no field left to its previous undefined value after calling an init function.
Diffstat (limited to 'xwayland/selection')
-rw-r--r--xwayland/selection/selection.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xwayland/selection/selection.c b/xwayland/selection/selection.c
index 26817fbb..4cc8b627 100644
--- a/xwayland/selection/selection.c
+++ b/xwayland/selection/selection.c
@@ -34,6 +34,7 @@ void xwm_selection_transfer_destroy_property_reply(
void xwm_selection_transfer_init(struct wlr_xwm_selection_transfer *transfer,
struct wlr_xwm_selection *selection) {
+ memset(transfer, 0, sizeof(*transfer));
transfer->selection = selection;
transfer->wl_client_fd = -1;
}
@@ -174,6 +175,7 @@ int xwm_handle_selection_event(struct wlr_xwm *xwm,
void xwm_selection_init(struct wlr_xwm_selection *selection,
struct wlr_xwm *xwm, xcb_atom_t atom) {
+ memset(selection, 0, sizeof(*selection));
wl_list_init(&selection->incoming);
wl_list_init(&selection->outgoing);