diff options
author | Simon Ser <contact@emersion.fr> | 2023-08-03 12:07:27 +0200 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2023-08-03 14:40:28 +0000 |
commit | c74f89d4f84bfed0284d3908aee5d207698c70c5 (patch) | |
tree | 6ded2e7ac9010daf75437ffd6ad45f0659412bbf /render/dmabuf.c | |
parent | 77dc1c28aa551616521b60f1a8727a25a45f82e1 (diff) |
Avoid using memcpy() to copy structs
We can just use a regular assignment instead. This is more
type-safe since there is no need to provide the struct size.
The remaining memcpy() calls perform array copies or copies from
void pointers (which may be unaligned).
Diffstat (limited to 'render/dmabuf.c')
-rw-r--r-- | render/dmabuf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/render/dmabuf.c b/render/dmabuf.c index 44b840f2..b0b8ef41 100644 --- a/render/dmabuf.c +++ b/render/dmabuf.c @@ -15,7 +15,7 @@ void wlr_dmabuf_attributes_finish(struct wlr_dmabuf_attributes *attribs) { bool wlr_dmabuf_attributes_copy(struct wlr_dmabuf_attributes *dst, const struct wlr_dmabuf_attributes *src) { - memcpy(dst, src, sizeof(struct wlr_dmabuf_attributes)); + *dst = *src; int i; for (i = 0; i < src->n_planes; ++i) { |