Avoid segfault when testing p_uttt->history
in get_next_outter_position()
This commit is contained in:
parent
f319f0e53c
commit
0ff026b4ca
1 changed files with 1 additions and 1 deletions
|
@ -124,7 +124,7 @@ e_player get_next_player_to_play(s_utictactoe *p_uttt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
e_location get_next_outer_position(s_utictactoe *p_uttt) {
|
e_location get_next_outer_position(s_utictactoe *p_uttt) {
|
||||||
if ( p_uttt->inner_tictactoes != NULL ) {
|
if ( p_uttt->inner_tictactoes != NULL && p_uttt->history != NULL) {
|
||||||
e_location pos = p_uttt->history->last_move->inner_position;
|
e_location pos = p_uttt->history->last_move->inner_position;
|
||||||
if ( p_uttt->inner_tictactoes[pos]->winner == NOBODY ) {
|
if ( p_uttt->inner_tictactoes[pos]->winner == NOBODY ) {
|
||||||
return pos;
|
return pos;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue