Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#117 compilation breaks with C89 compilers

None
closed-fixed
Dan Fandrich
libexif (61)
5
2013-07-13
2013-05-24
Guenter Knauf
No

With C89 compiles there's one place in the code which beraks compilation;
this is due to var declaration after statement; please apply the following patch which fixes this:
--- libexif/exif-entry.c.orig Thu Jul 12 20:31:56 2012
+++ libexif/exif-entry.c Thu May 23 05:58:30 2013
@@ -1375,12 +1375,13 @@
case EXIF_TAG_XP_KEYWORDS:
case EXIF_TAG_XP_SUBJECT:
{
+ unsigned short *utf16;
/* Sanity check the size to prevent overflow */
if (e->size+sizeof(unsigned short) < e->size) break;

/* The tag may not be U+0000-terminated , so make a local
U+0000-terminated copy before converting it */
- unsigned short *utf16 = exif_mem_alloc (e->priv->mem, e->size+sizeof(unsigned short));
+ utf16 = exif_mem_alloc (e->priv->mem, e->size+sizeof(unsigned short));
if (!utf16) break;
memcpy(utf16, e->data, e->size);
utf16[e->size/sizeof(unsigned short)] = 0;

thanks!

Discussion

  • Guenter Knauf
    Guenter Knauf
    2013-05-24

    • assigned_to: nobody --> dfandrich
     
  • Dan Fandrich
    Dan Fandrich
    2013-07-13

    • status: open --> closed-fixed
    • Group: -->
     
  • Dan Fandrich
    Dan Fandrich
    2013-07-13

    Fixed in CVS.