Zero-initialize structs in init functions

Ensures there is no field left to its previous undefined value after
calling an init function.
This commit is contained in:
Simon Ser 2022-04-26 09:43:54 +02:00
parent 54653b5d95
commit 6c350799b2
20 changed files with 29 additions and 1 deletions

View file

@ -36,7 +36,7 @@
void wlr_backend_init(struct wlr_backend *backend,
const struct wlr_backend_impl *impl) {
assert(backend);
memset(backend, 0, sizeof(*backend));
backend->impl = impl;
wl_signal_init(&backend->events.destroy);
wl_signal_init(&backend->events.new_input);