summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2008-10-28 22:39:54 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2008-10-28 22:39:54 +0000
commit24cf2ae8045beaf158f49687bf15a179ed0e69fe (patch)
tree4e1fd7e8b7536b7778541b3dd72e8263101b93e5 /apps
parent8fbbbb77bf2f8d41063413af8bca28d608010a9b (diff)
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
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/sudoku/sudoku.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c
index b709002880..5c916f570d 100644
--- a/apps/plugins/sudoku/sudoku.c
+++ b/apps/plugins/sudoku/sudoku.c
@@ -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;
}