summaryrefslogtreecommitdiff
path: root/apps/plugins/bubbles.c
diff options
context:
space:
mode:
authorHristo Kovachev <bger@rockbox.org>2006-03-21 11:18:40 +0000
committerHristo Kovachev <bger@rockbox.org>2006-03-21 11:18:40 +0000
commit7c7c03a2b9ecbd265d913c81b374e13eaa4f1078 (patch)
treeee8449bb2eea05f5abf90e4fc5228b8b3ad366e0 /apps/plugins/bubbles.c
parentd694a21b7f3a044304d4dc1ba2a3d015c01ff6cf (diff)
downloadrockbox-7c7c03a2b9ecbd265d913c81b374e13eaa4f1078.zip
rockbox-7c7c03a2b9ecbd265d913c81b374e13eaa4f1078.tar.gz
rockbox-7c7c03a2b9ecbd265d913c81b374e13eaa4f1078.tar.bz2
rockbox-7c7c03a2b9ecbd265d913c81b374e13eaa4f1078.tar.xz
Patch #4872 by Mikael Magnusson: fixes bubbles game overflowing stack
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9155 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/bubbles.c')
-rwxr-xr-xapps/plugins/bubbles.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c
index f40f91e..03f3b76 100755
--- a/apps/plugins/bubbles.c
+++ b/apps/plugins/bubbles.c
@@ -1769,6 +1769,8 @@ static int bubbles_searchgroup(struct game_context* bb, int row, int col) {
int adj = row%2;
int mytype = bb->playboard[row][col].type;
+ if (bb->playboard[row][col].ingroup)
+ return 0;
bb->playboard[row][col].ingroup = true;
/* recursively call neighbors */
@@ -1875,6 +1877,8 @@ static int bubbles_remove(struct game_context* bb) {
static void bubbles_anchored(struct game_context* bb, int row, int col) {
int adj = row%2;
+ if (bb->playboard[row][col].anchored)
+ return;
/* mark bubble */
bb->playboard[row][col].anchored = true;
@@ -2289,7 +2293,6 @@ static int bubbles(struct game_context* bb) {
int button;
int buttonres;
unsigned int startlevel = 0;
- char str[30];
char *title = "Bubbles";
bool startgame = false;
bool showscores = false;
@@ -2304,6 +2307,7 @@ static int bubbles(struct game_context* bb) {
* menu *
********************/
while(!startgame){
+ char str[30];
rb->lcd_clear_display();
if(!showscores) {
@@ -2466,7 +2470,6 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {
struct game_context bb;
bool exit = false;
int position;
- char str[19];
/* plugin init */
(void)parameter;
@@ -2486,6 +2489,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {
while(!exit) {
switch(bubbles(&bb)){
+ char str[19];
case BB_WIN:
rb->splash(HZ*2, true, "You Win!");