summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-06-02 10:35:19 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-06-02 10:35:19 +0000
commite8a662432af5eedc3b66d505f6d2501f68d50dce (patch)
tree7d792a369813d3ac96d5b7335f2979b3cbf1c243 /utils
parent57ad6f9b039f810880f46c1b447955a3c3df4842 (diff)
downloadrockbox-e8a662432af5eedc3b66d505f6d2501f68d50dce.tar.gz
rockbox-e8a662432af5eedc3b66d505f6d2501f68d50dce.tar.bz2
rockbox-e8a662432af5eedc3b66d505f6d2501f68d50dce.zip
clip int scanning to 15 digits to remove an unecessary malloc().
fix %xl tag git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26477 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils')
-rw-r--r--utils/themeeditor/skin_scan.c13
-rw-r--r--utils/themeeditor/tag_table.c2
2 files changed, 7 insertions, 8 deletions
diff --git a/utils/themeeditor/skin_scan.c b/utils/themeeditor/skin_scan.c
index 599683db54..19e959b5b8 100644
--- a/utils/themeeditor/skin_scan.c
+++ b/utils/themeeditor/skin_scan.c
@@ -101,9 +101,9 @@ char* scan_string(char** document)
int scan_int(char** document)
{
- char* cursor = *document;
+ char* cursor = *document, *end;
int length = 0;
- char* buffer = NULL;
+ char buffer[16];
int retval;
int i;
@@ -118,9 +118,9 @@ int scan_int(char** document)
length++;
cursor++;
}
-
- buffer = skin_alloc_string(length);
-
+ if (length > 15)
+ length = 15;
+ end = cursor;
/* Copying to the buffer while avoiding comments */
cursor = *document;
buffer[length] = '\0';
@@ -138,9 +138,8 @@ int scan_int(char** document)
}
retval = atoi(buffer);
- free(buffer);
- *document = cursor;
+ *document = end;
return retval;
}
diff --git a/utils/themeeditor/tag_table.c b/utils/themeeditor/tag_table.c
index d128e5c0fa..eaf490833c 100644
--- a/utils/themeeditor/tag_table.c
+++ b/utils/themeeditor/tag_table.c
@@ -167,7 +167,7 @@ struct tag_info legal_tags[] =
{ SKIN_TOKEN_DISABLE_THEME, "wd", "" },
{ SKIN_TOKEN_DRAW_INBUILTBAR, "wi", "" },
- { SKIN_TOKEN_IMAGE_PRELOAD, "xl", "SFIIi" },
+ { SKIN_TOKEN_IMAGE_PRELOAD, "xl", "SFII|I" },
{ SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY, "xd", "S" },
{ SKIN_TOKEN_IMAGE_PRELOAD, "x", "SFII" },