summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2010-02-22 06:00:49 +0000
committerTeruaki Kawashima <teru@rockbox.org>2010-02-22 06:00:49 +0000
commitd151371836eca444b4e5e9228a9a572128c6f8a3 (patch)
tree776bf6b635d2f8a1198b7d2764689d2807cb18cf
parentc36a644cc6c14e14fc24ce35a5e94cb9cb47fd27 (diff)
correct checking size in function get_image_filename.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24844 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/skin_engine/skin_parser.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 4363a293c8..7f4406a0bf 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -571,15 +571,14 @@ char *get_image_filename(const char *start, const char* bmpdir,
char *buf, int buf_size)
{
const char *end = strchr(start, '|');
+ int bmpdirlen = strlen(bmpdir);
- if ( !end || (end - start) >= (buf_size - (int)ROCKBOX_DIR_LEN - 2) )
+ if ( !end || (end - start) >= (buf_size - bmpdirlen - 2) )
{
- buf = "\0";
+ buf[0] = '\0';
return NULL;
}
- int bmpdirlen = strlen(bmpdir);
-
strcpy(buf, bmpdir);
buf[bmpdirlen] = '/';
memcpy( &buf[bmpdirlen + 1], start, end - start);