Error in pointer

This commit is contained in:
Yorick Barbanneau 2021-10-01 00:25:35 +02:00
parent b44e75e56e
commit 82cc816f76

View file

@ -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;i<TICTACTOE_SIZE; i++){
value->content[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;
}
}