use sizeof(*pointer) instead of sizeof(struct)

This commit is contained in:
Leonardo Hernández Hernández 2023-11-25 12:40:13 -06:00
parent 922e117fc5
commit 1f10e69b4c
Failed to generate hash of commit

2
dwl.c
View file

@ -815,7 +815,7 @@ createlayersurface(struct wl_listener *listener, void *data)
return;
}
layersurface = wlr_layer_surface->data = ecalloc(1, sizeof(LayerSurface));
layersurface = wlr_layer_surface->data = ecalloc(1, sizeof(*layersurface));
layersurface->type = LayerShell;
LISTEN(&wlr_layer_surface->surface->events.commit,
&layersurface->surface_commit, commitlayersurfacenotify);