diff --git a/src/model.c b/src/model.c index 76fe898..ef7eed7 100644 --- a/src/model.c +++ b/src/model.c @@ -28,7 +28,7 @@ s_tictactoe *create_empty_tictactoe() { value->winner = NOBODY; value->content = (e_player*) malloc(sizeof(e_player) * TICTACTOE_SIZE); if ( ! value->content ) { - return value->content; + return NULL; } for ( int i=0;icontent[i] = NOBODY; @@ -115,7 +115,7 @@ e_player get_next_player_to_play(s_utictactoe *p_uttt) { e_location get_next_outer_position(s_utictactoe *p_uttt) { if ( p_uttt->inner_tictactoes != NULL ) { e_location pos = p_uttt->history->last_move->inner_position; - if ( p_uttt->inner_tictactoes->content[pos]->winner == NOBODY ) { + if ( p_uttt->inner_tictactoes[pos]->winner == NOBODY ) { return pos; } }