From 66e3fe20bdd09ef431f612e02ffe0ce9809b5cc2 Mon Sep 17 00:00:00 2001 From: Julian T Date: Sat, 21 Mar 2020 19:40:48 +0100 Subject: Fixed bugs from clang scan-build --- pgm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pgm.c') diff --git a/pgm.c b/pgm.c index a1d3124..b3f233f 100644 --- a/pgm.c +++ b/pgm.c @@ -31,7 +31,7 @@ color_t *color_set(color_t *c, COORD_T r, COORD_T g, COORD_T b) color_t *color_add(color_t *dest, color_t *a, color_t *b) { if (!dest) { - dest = (color_t *) malloc(sizeof(dest)); + dest = (color_t *) malloc(sizeof(color_t)); } COORD_T tmp = a->r + b->r; @@ -49,7 +49,7 @@ color_t *color_add(color_t *dest, color_t *a, color_t *b) color_t *color_scale(color_t *dest, color_t *a, COORD_T b) { if (!dest) { - dest = (color_t *) malloc(sizeof(dest)); + dest = (color_t *) malloc(sizeof(color_t)); } COORD_T tmp = a->r * b; @@ -67,7 +67,7 @@ color_t *color_scale(color_t *dest, color_t *a, COORD_T b) color_t *color_scale_vector(color_t *dest, color_t *a, vector_t *v) { if (!dest) { - dest = (color_t *) malloc(sizeof(dest)); + dest = (color_t *) malloc(sizeof(color_t)); } dest->r = a->r * v->x; -- cgit v1.2.3