Update of /cvsroot/libexif/libexif/libexif
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15133/libexif
Modified Files:
exif-entry.c
Log Message:
use full initializers
Index: exif-entry.c
===================================================================
RCS file: /cvsroot/libexif/libexif/libexif/exif-entry.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -p -d -r1.102 -r1.103
--- exif-entry.c 15 Jun 2007 06:49:42 -0000 1.102
+++ exif-entry.c 26 Jun 2007 02:31:41 -0000 1.103
@@ -535,7 +535,7 @@ static struct {
{2, {N_("Adobe RGB"), NULL}},
{0xffff, {N_("Uncalibrated"), NULL}},
{0x0000, {NULL}}}},
- {0, }
+ {0, { { 0, {NULL}}} }
};
const char *
@@ -1095,6 +1095,7 @@ exif_entry_get_value (ExifEntry *e, char
}
}
+ val[maxlen-1] = '\0'; /* make sure the returned string is zero terminated */
return val;
}
@@ -1126,6 +1127,7 @@ exif_entry_initialize (ExifEntry *e, Exi
e->format = EXIF_FORMAT_LONG;
e->size = exif_format_get_size (e->format) * e->components;
e->data = exif_entry_alloc (e, e->size);
+ if (!e->data) break;
break;
/* SHORT, 1 component, no default */
@@ -1154,6 +1156,7 @@ exif_entry_initialize (ExifEntry *e, Exi
e->format = EXIF_FORMAT_SHORT;
e->size = exif_format_get_size (e->format) * e->components;
e->data = exif_entry_alloc (e, e->size);
+ if (!e->data) break;
exif_set_short (e->data, o, 0);
break;
@@ -1165,6 +1168,7 @@ exif_entry_initialize (ExifEntry *e, Exi
e->format = EXIF_FORMAT_SHORT;
e->size = exif_format_get_size (e->format) * e->components;
e->data = exif_entry_alloc (e, e->size);
+ if (!e->data) break;
exif_set_short (e->data, o, 1);
break;
@@ -1175,6 +1179,7 @@ exif_entry_initialize (ExifEntry *e, Exi
e->format = EXIF_FORMAT_SHORT;
e->size = exif_format_get_size (e->format) * e->components;
e->data = exif_entry_alloc (e, e->size);
+ if (!e->data) break;
exif_set_short (e->data, o, 2);
break;
@@ -1184,6 +1189,7 @@ exif_entry_initialize (ExifEntry *e, Exi
e->format = EXIF_FORMAT_SHORT;
e->size = exif_format_get_size (e->format) * e->components;
e->data = exif_entry_alloc (e, e->size);
+ if (!e->data) break;
exif_set_short (e->data, o, 3);
break;
@@ -1221,6 +1227,7 @@ exif_entry_initialize (ExifEntry *e, Exi
e->format = EXIF_FORMAT_SRATIONAL;
e->size = exif_format_get_size (e->format) * e->components;
e->data = exif_entry_alloc (e, e->size);
+ if (!e->data) break;
break;
/* RATIONAL, 1 component, no default */
@@ -1241,6 +1248,7 @@ exif_entry_initialize (ExifEntry *e, Exi
e->format = EXIF_FORMAT_RATIONAL;
e->size = exif_format_get_size (e->format) * e->components;
e->data = exif_entry_alloc (e, e->size);
+ if (!e->data) break;
break;
/* RATIONAL, 1 component, default 72/1 */
@@ -1250,6 +1258,7 @@ exif_entry_initialize (ExifEntry *e, Exi
e->format = EXIF_FORMAT_RATIONAL;
e->size = exif_format_get_size (e->format) * e->components;
e->data = exif_entry_alloc (e, e->size);
+ if (!e->data) break;
r.numerator = 72;
r.denominator = 1;
exif_set_rational (e->data, o, r);
@@ -1261,6 +1270,7 @@ exif_entry_initialize (ExifEntry *e, Exi
e->format = EXIF_FORMAT_RATIONAL;
e->size = exif_format_get_size (e->format) * e->components;
e->data = exif_entry_alloc (e, e->size);
+ if (!e->data) break;
break;
/* RATIONAL, 6 components */
|