summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2010-06-03 13:32:12 +0000
committerTeruaki Kawashima <teru@rockbox.org>2010-06-03 13:32:12 +0000
commit6e39dc9e27e852bcf88490ee0c5e267c90f0513b (patch)
tree2c6c2251391c8661d8279ad665fbdc72a7d4ec2e /apps
parentd68710e9fc96ebe551009f7d9f02fe1f481847e0 (diff)
downloadrockbox-6e39dc9e27e852bcf88490ee0c5e267c90f0513b.tar.gz
rockbox-6e39dc9e27e852bcf88490ee0c5e267c90f0513b.tar.bz2
rockbox-6e39dc9e27e852bcf88490ee0c5e267c90f0513b.zip
Correct reusing buffers if the backdrop file is already loaded.
FS#11305 by myself. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26510 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/skin_engine/skin_backdrops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/gui/skin_engine/skin_backdrops.c b/apps/gui/skin_engine/skin_backdrops.c
index 77de8bdc1a..a32bfbe589 100644
--- a/apps/gui/skin_engine/skin_backdrops.c
+++ b/apps/gui/skin_engine/skin_backdrops.c
@@ -31,7 +31,7 @@
#if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1))
static struct skin_backdrop {
- char name[MAX_FILENAME+1];
+ char name[MAX_PATH];
char *buffer;
enum screen_type screen;
} backdrops[SKINNABLE_SCREENS_COUNT*NB_SCREENS];
@@ -88,7 +88,7 @@ char* skin_backdrop_load(char* backdrop, char *bmpdir, enum screen_type screen)
for(i=0;i<SKINNABLE_SCREENS_COUNT*NB_SCREENS;i++)
{
- if (!strcmp(backdrops[i].name, backdrop) && backdrops[i].screen == screen)
+ if (!strcmp(backdrops[i].name, filename) && backdrops[i].screen == screen)
{
return backdrops[i].buffer;
}
@@ -105,7 +105,7 @@ char* skin_backdrop_load(char* backdrop, char *bmpdir, enum screen_type screen)
return NULL;
loaded = screens[screen].backdrop_load(filename, bdrop->buffer);
bdrop->screen = screen;
- strlcpy(bdrop->name, backdrop, MAX_FILENAME+1);
+ strlcpy(bdrop->name, filename, sizeof(bdrop->name));
return loaded ? bdrop->buffer : NULL;
}