diff options
author | Alexander Orzechowski <alex@ozal.ski> | 2023-10-03 01:51:07 -0400 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2023-10-03 01:51:07 -0400 |
commit | 1b0694b79481643cb456d03e1be50a1b4f6ca591 (patch) | |
tree | c693c5de3ee7ebd52873f6ec063118408f0bd28a /xcursor | |
parent | a09d6494397bdd28a3254d2e646212afb5a3049c (diff) |
treewide: Migrate from sizeof(struct) to sizeof(*pointer) where practical
Diffstat (limited to 'xcursor')
-rw-r--r-- | xcursor/xcursor.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; |