From 1b0694b79481643cb456d03e1be50a1b4f6ca591 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Tue, 3 Oct 2023 01:51:07 -0400 Subject: treewide: Migrate from sizeof(struct) to sizeof(*pointer) where practical --- xcursor/xcursor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xcursor') diff --git a/xcursor/xcursor.c b/xcursor/xcursor.c index 1ebaef0b..46085918 100644 --- a/xcursor/xcursor.c +++ b/xcursor/xcursor.c @@ -149,7 +149,7 @@ xcursor_image_create(int width, int height) if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) return NULL; - image = malloc(sizeof(struct xcursor_image) + + image = malloc(sizeof(*image) + width * height * sizeof(uint32_t)); if (!image) return NULL; @@ -173,7 +173,7 @@ xcursor_images_create(int size) { struct xcursor_images *images; - images = malloc(sizeof(struct xcursor_images) + + images = malloc(sizeof(*images) + size * sizeof(struct xcursor_image *)); if (!images) return NULL; @@ -228,7 +228,7 @@ xcursor_file_header_create(uint32_t ntoc) if (ntoc > 0x10000) return NULL; - file_header = malloc(sizeof(struct xcursor_file_header) + + file_header = malloc(sizeof(*file_header) + ntoc * sizeof(struct xcursor_file_toc)); if (!file_header) return NULL; -- cgit v1.2.3