forked from len0rd/rockbox
Fix sudoku crash when using reload without previously saved state (FS#9509 by Henri Valta). Fix a similar issue when using reload after generating a new sudoku by me.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18906 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8fbbbb77bf
commit
24cf2ae804
1 changed files with 11 additions and 0 deletions
|
@ -599,6 +599,12 @@ void default_state(struct sudoku_state_t* state)
|
|||
}
|
||||
}
|
||||
|
||||
/* initialize the saved board so reload function works */
|
||||
rb->memcpy(state->savedboard,state->currentboard,81);
|
||||
#ifdef SUDOKU_BUTTON_POSSIBLE
|
||||
rb->memcpy(state->savedpossible,state->possiblevals,81);
|
||||
#endif
|
||||
|
||||
state->x=0;
|
||||
state->y=0;
|
||||
state->editmode=0;
|
||||
|
@ -1103,6 +1109,11 @@ bool sudoku_generate(struct sudoku_state_t* state)
|
|||
display_board(&new_state);
|
||||
rb->splash(HZ*2, "Aborted");
|
||||
}
|
||||
/* initialize the saved board so reload function works */
|
||||
rb->memcpy(state->savedboard,state->currentboard,81);
|
||||
#ifdef SUDOKU_BUTTON_POSSIBLE
|
||||
rb->memcpy(state->savedpossible,state->possiblevals,81);
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue