summaryrefslogtreecommitdiff
path: root/image/ico.c
diff options
context:
space:
mode:
Diffstat (limited to 'image/ico.c')
-rw-r--r--image/ico.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/image/ico.c b/image/ico.c
index ff8f9204c..e455a59d9 100644
--- a/image/ico.c
+++ b/image/ico.c
@@ -100,7 +100,7 @@ static bool nsico_convert(struct content *c)
union content_msg_data msg_data;
const char *data;
unsigned long size;
- char title[512];
+ char *title;
/* set the ico data */
data = content__get_source_data(c, &size);
@@ -122,14 +122,19 @@ static bool nsico_convert(struct content *c)
return false;
}
- /* Store our content width and description */
+ /* Store our content width, height and calculate size */
c->width = ico->ico->width;
c->height = ico->ico->height;
- snprintf(title, sizeof(title), messages_get("ICOTitle"),
+ c->size += (ico->ico->width * ico->ico->height * 4) + 16 + 44;
+
+ /* set title text */
+ title = messages_get_buff("ICOTitle",
nsurl_access_leaf(llcache_handle_get_url(c->llcache)),
c->width, c->height);
- content__set_title(c, title);
- c->size += (ico->ico->width * ico->ico->height * 4) + 16 + 44;
+ if (title != NULL) {
+ content__set_title(c, title);
+ free(title);
+ }
/* select largest icon to ensure one can be selected */
bmp = ico_find(ico->ico, 255, 255);