From 9fe6e0214fb2c13ca68ddeb2a7492de940adb99e Mon Sep 17 00:00:00 2001 From: Kevin Ferrare Date: Thu, 19 Jul 2007 04:28:10 +0000 Subject: Demystify plugin would have crashed ... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13928 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/demystify.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'apps/plugins') diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c index 1ea9806a7b..3164eefb23 100644 --- a/apps/plugins/demystify.c +++ b/apps/plugins/demystify.c @@ -52,7 +52,8 @@ const struct button_mapping *plugin_contexts[] remote_directions #endif }; - +#define NB_ACTION_CONTEXTS \ + sizeof(plugin_contexts)/sizeof(struct button_mapping*) #ifdef HAVE_LCD_COLOR struct line_color { @@ -380,8 +381,8 @@ int plugin_main(void) rb->yield(); else rb->sleep(sleep_time); - - action = pluginlib_getaction(rb, TIMEOUT_NOBLOCK, plugin_contexts, 3); + action = pluginlib_getaction(rb, TIMEOUT_NOBLOCK, + plugin_contexts, NB_ACTION_CONTEXTS); switch(action) { case DEMYSTIFY_QUIT: -- cgit v1.2.3