commit a38802ec0a0cdb7c33ac1629e589eb4cb0117f4d
parent e3c754500e706c27e3820c9ce007525edc38b046
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 2 Jan 2008 10:22:27 +0000
better
Diffstat:
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/plugins/tiffextractor.c b/src/plugins/tiffextractor.c
@@ -175,12 +175,10 @@ libextractor_tiff_extract (char *filename,
}
if (width != -1)
{
- char *tmp;
- tmp = malloc (128);
- sprintf (tmp, "%ux%u",
+ char tmp[128];
+ snprintf (tmp, 128, "%ux%u",
(unsigned int) width, (unsigned int) length);
addKeyword (&prev, strdup (tmp), EXTRACTOR_SIZE);
- free (tmp);
}
break;
case TAG_WIDTH:
@@ -190,12 +188,10 @@ libextractor_tiff_extract (char *filename,
width = entry.value_or_offset;
if (length != -1)
{
- char *tmp;
- tmp = malloc (128);
- sprintf (tmp, "%ux%u",
+ char tmp[128];
+ snprintf (tmp, 128, "%ux%u",
(unsigned int) width, (unsigned int) length);
addKeyword (&prev, strdup (tmp), EXTRACTOR_SIZE);
- free (tmp);
}
break;
case TAG_SOFTWARE: