diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2010-04-03 11:55:28 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2010-04-03 11:55:28 +0000 |
commit | 49810d8191e9a806ceb8a92c68369d8dac261f0d (patch) | |
tree | d57d82c882eb92f0d0bcf409b43a54beadc91e04 /image/ico.c | |
parent | 6835a312b7df68c23fec9930b8e0aec94b537e5f (diff) | |
download | netsurf-49810d8191e9a806ceb8a92c68369d8dac261f0d.tar.gz netsurf-49810d8191e9a806ceb8a92c68369d8dac261f0d.tar.bz2 |
Use mutator to modify content's title field.
svn path=/trunk/netsurf/; revision=10231
Diffstat (limited to 'image/ico.c')
-rw-r--r-- | image/ico.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/image/ico.c b/image/ico.c index 233018cea..3335a6a58 100644 --- a/image/ico.c +++ b/image/ico.c @@ -60,6 +60,7 @@ bool nsico_convert(struct content *c) union content_msg_data msg_data; const char *data; unsigned long size; + char title[100]; /* set the ico data */ ico = c->data.ico.ico; @@ -86,11 +87,10 @@ bool nsico_convert(struct content *c) /* Store our content width and description */ c->width = ico->width; c->height = ico->height; - c->title = malloc(100); - if (c->title) - snprintf(c->title, 100, messages_get("ICOTitle"), c->width, - c->height, size); - c->size += (ico->width * ico->height * 4) + 16 + 44 + 100; + snprintf(title, sizeof(title), messages_get("ICOTitle"), + c->width, c->height, size); + content__set_title(c, title); + c->size += (ico->width * ico->height * 4) + 16 + 44; /* exit as a success */ bmp = ico_find(c->data.ico.ico, 255, 255); @@ -167,7 +167,6 @@ void nsico_destroy(struct content *c) { ico_finalise(c->data.ico.ico); free(c->data.ico.ico); - free(c->title); } #endif |