aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2020-03-21 19:40:48 +0100
committerJulian T <julian@jtle.dk>2020-03-21 19:40:48 +0100
commit66e3fe20bdd09ef431f612e02ffe0ce9809b5cc2 (patch)
treedba326eaf9672018848f008b7c6549e311d095c8
parentee18fc8e303c4de1fa68e8cfc007cb31578d0c3a (diff)
Fixed bugs from clang scan-build
-rw-r--r--pgm.c6
1 files changed, 3 insertions, 3 deletions
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;