diff options
author | Ian C <ianc@noddybox.co.uk> | 2018-12-21 10:22:22 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2018-12-21 10:22:22 +0000 |
commit | 859dc1c2044140f7bae42705940e44b4c94bd07e (patch) | |
tree | 0da409b91968ba725f14ef34f8bc855ca2584fc1 | |
parent | 3e4827768ddfe27fbacc1f0f1cec3bd8c891e001 (diff) |
Fixed SEGV when trying to move an empty column.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | csol.c | 6 |
2 files changed, 5 insertions, 3 deletions
@@ -25,7 +25,7 @@ LIBS=-lcurses csol: csol.c - $(CC) -o csol csol.c $(LIBS) + $(CC) -g -o csol csol.c $(LIBS) clean: -rm -f csol csol.exe core @@ -696,14 +696,16 @@ static void Klondike(int draw) { int can_move = FALSE; - if (column_up[move_pos_x].card[move_pos_y].value == 13 && + if (column_up[move_pos_x].no && + column_up[move_pos_x].card[move_pos_y].value == 13 && column_up[pos_x].no == 0 && column_down[pos_x].no == 0) { can_move = TRUE; } else { - if (CanCardSitOnTop + if (column_up[move_pos_x].no && + CanCardSitOnTop (column_up[move_pos_x].card[move_pos_y], TopOfPile(&column_up[pos_x]))) { |