From: Jan P. <pa...@us...> - 2004-06-15 16:22:08
|
Update of /cvsroot/libexif/libexif/libexif/olympus In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6067 Modified Files: mnote-olympus-entry.c Log Message: MNOTE_OLYMPUS_TAG_INFO: handle length 53 (in addition to 52) & extract the string Index: mnote-olympus-entry.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/olympus/mnote-olympus-entry.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- mnote-olympus-entry.c 7 Jun 2004 14:08:57 -0000 1.13 +++ mnote-olympus-entry.c 15 Jun 2004 16:21:56 -0000 1.14 @@ -52,8 +52,16 @@ } \ } -#undef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#define CC2(number,t1,t2,v,maxlen) \ +{ \ + if ((number != t1) && (number != t2)) { \ + snprintf (v, maxlen, \ + _("Invalid number of components (%i, " \ + "expected %i or %i)."), (int) number, \ + (int) t1, (int) t2); \ + break; \ + } \ +} static struct { ExifTag tag; @@ -423,7 +431,8 @@ break; case MNOTE_OLYMPUS_TAG_INFO: CF (entry->format, EXIF_FORMAT_ASCII, v, maxlen); - CC (entry->components, 52, v, maxlen); + CC2 (entry->components, 52, 53, v, maxlen); + strncpy (v, entry->data, MIN (maxlen, entry->size)); break; case MNOTE_OLYMPUS_TAG_ID: CF (entry->format, EXIF_FORMAT_UNDEFINED, v, maxlen); |