From 49810d8191e9a806ceb8a92c68369d8dac261f0d Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 3 Apr 2010 11:55:28 +0000 Subject: Use mutator to modify content's title field. svn path=/trunk/netsurf/; revision=10231 --- image/gif.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'image/gif.c') 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); } -- cgit v1.2.3