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/bmp.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/bmp.c')
-rw-r--r-- | image/bmp.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/image/bmp.c b/image/bmp.c index d4584f85d..23ea740e9 100644 --- a/image/bmp.c +++ b/image/bmp.c @@ -72,6 +72,7 @@ bool nsbmp_convert(struct content *c) uint32_t swidth; const char *data; unsigned long size; + char title[100]; /* set the bmp data */ bmp = c->data.bmp.bmp; @@ -98,12 +99,11 @@ bool nsbmp_convert(struct content *c) c->width = bmp->width; c->height = bmp->height; LOG(("BMP width %u height %u", c->width, c->height)); - c->title = malloc(100); - if (c->title) - snprintf(c->title, 100, messages_get("BMPTitle"), c->width, - c->height, size); + snprintf(title, sizeof(title), messages_get("BMPTitle"), + c->width, c->height, size); + content__set_title(c, title); swidth = bmp->bitmap_callbacks.bitmap_get_bpp(bmp->bitmap) * bmp->width; - c->size += (swidth * bmp->height) + 16 + 44 + 100; + c->size += (swidth * bmp->height) + 16 + 44; /* exit as a success */ c->bitmap = bmp->bitmap; @@ -159,7 +159,6 @@ void nsbmp_destroy(struct content *c) { bmp_finalise(c->data.bmp.bmp); free(c->data.bmp.bmp); - free(c->title); } |