diff --git a/lib/card.c b/lib/card.c index 492d23e..6175209 100644 --- a/lib/card.c +++ b/lib/card.c @@ -6,7 +6,7 @@ struct card *initialize_card() { struct card *card = NULL; - card = malloc(sizeof(card)); + card = malloc(sizeof(*card)); card->frame = initialize_frame(); card->value = NO_VALUE; diff --git a/lib/display.c b/lib/display.c index 74b7547..531e614 100644 --- a/lib/display.c +++ b/lib/display.c @@ -22,7 +22,7 @@ void init_curses() { char *card_suit(enum suit suit) { char *card_suit; - card_suit = malloc(5 * sizeof(card_suit)); + card_suit = malloc(5 * sizeof(*card_suit)); switch(suit) { case DIAMONDS: strcpy(card_suit, DIAMONDS_SYMBOL); break; @@ -38,7 +38,7 @@ char *card_suit(enum suit suit) { char *card_value(enum value value) { char *card_value; - card_value = malloc(2 * sizeof(card_value)); + card_value = malloc(2 * sizeof(*card_value)); switch(value) { case TWO: card_value = "2"; break; diff --git a/lib/frame.c b/lib/frame.c index 0bb0327..1a6b2fe 100644 --- a/lib/frame.c +++ b/lib/frame.c @@ -13,7 +13,7 @@ WINDOW *initialize_shape() { struct frame *initialize_frame() { struct frame *frame = NULL; - frame = malloc(sizeof(frame)); + frame = malloc(sizeof(*frame)); frame->shape = initialize_shape(); frame->height = FRAME_HEIGHT;