diff options
author | Julian T <julian@jtle.dk> | 2020-03-21 19:40:48 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-03-21 19:40:48 +0100 |
commit | 66e3fe20bdd09ef431f612e02ffe0ce9809b5cc2 (patch) | |
tree | dba326eaf9672018848f008b7c6549e311d095c8 | |
parent | ee18fc8e303c4de1fa68e8cfc007cb31578d0c3a (diff) |
Fixed bugs from clang scan-build
-rw-r--r-- | pgm.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; |