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/gif.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/gif.c')
-rw-r--r-- | image/gif.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/image/gif.c b/image/gif.c index 8c5025af6..01ea57420 100644 --- a/image/gif.c +++ b/image/gif.c @@ -86,6 +86,7 @@ bool nsgif_convert(struct content *c) union content_msg_data msg_data; const char *data; unsigned long size; + char title[100]; /* Get the animation */ gif = c->data.gif.gif; @@ -123,12 +124,10 @@ bool nsgif_convert(struct content *c) /* Store our content width and description */ c->width = gif->width; c->height = gif->height; - c->title = malloc(100); - if (c->title) { - snprintf(c->title, 100, messages_get("GIFTitle"), c->width, - c->height, size); - } - c->size += (gif->width * gif->height * 4) + 16 + 44 + 100; + snprintf(title, sizeof(title), messages_get("GIFTitle"), + c->width, c->height, size); + content__set_title(c, title); + c->size += (gif->width * gif->height * 4) + 16 + 44; /* Schedule the animation if we have one */ c->data.gif.current_frame = 0; @@ -195,7 +194,6 @@ void nsgif_destroy(struct content *c) schedule_remove(nsgif_animate, c); gif_finalise(c->data.gif.gif); free(c->data.gif.gif); - free(c->title); } |