diff options
author | Simon Ser <contact@emersion.fr> | 2022-04-26 09:43:54 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-04-28 10:09:50 +0200 |
commit | 6c350799b22ddc5cb89467c95692437bbf0116b9 (patch) | |
tree | 4559c68cb117d9c044e79fb0fbb7453042538375 /backend/drm | |
parent | 54653b5d95935e379e26db5518456a66384b5405 (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 'backend/drm')
-rw-r--r-- | backend/drm/drm.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 2b573295..5a828426 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -380,6 +380,7 @@ static bool drm_crtc_page_flip(struct wlr_drm_connector *conn, static void drm_connector_state_init(struct wlr_drm_connector_state *state, struct wlr_drm_connector *conn, const struct wlr_output_state *base) { + memset(state, 0, sizeof(*state)); state->base = base; state->modeset = base->committed & (WLR_OUTPUT_STATE_ENABLED | WLR_OUTPUT_STATE_MODE); |