2004-09-12 Lutz Mueller <lutz@users.sourceforge.net>
authorLutz Mueller <lutz.s.mueller@gmail.com>
Sun, 12 Sep 2004 19:52:39 +0000 (21:52 +0200)
committerLutz Mueller <lutz.s.mueller@gmail.com>
Sun, 12 Sep 2004 19:52:39 +0000 (21:52 +0200)
Patch by marcusmeissner@users.sourceforge.net: Some format string
fixes, wrong argument list fixed, format string problems avoided.

ChangeLog
libexif/exif-log.h
libexif/olympus/exif-mnote-data-olympus.c
libexif/pentax/mnote-pentax-entry.c

index 1bfc6e8..7d2af61 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-12  Lutz Mueller <lutz@users.sourceforge.net>
+
+       Patch by marcusmeissner@users.sourceforge.net: Some format string
+       fixes, wrong argument list fixed, format string problems avoided.
+
 2004-09-09  Lutz Mueller <lutz@users.sourceforge.net>
 
        * configure.in: Remove "([external])" after AM_GNU_GETTEXT as it
index 9831b2a..6a067b8 100644 (file)
@@ -49,7 +49,12 @@ typedef void (* ExifLogFunc) (ExifLog *log, ExifLogCode, const char *domain,
 void     exif_log_set_func (ExifLog *log, ExifLogFunc func, void *data);
 
 void     exif_log  (ExifLog *log, ExifLogCode, const char *domain,
-                   const char *format, ...);
+                   const char *format, ...)
+#ifdef __GNUC__
+                       __attribute__((__format__(printf,4,5)))
+#endif
+;
+
 void     exif_logv (ExifLog *log, ExifLogCode, const char *domain,
                    const char *format, va_list args);
 
index e370f15..c666a22 100644 (file)
@@ -110,7 +110,10 @@ exif_mnote_data_olympus_save (ExifMnoteData *ne,
                (*buf)[6] = n->version;
                o2 += 2; *buf_size += 2;
                if (n->version == 2) {
-                       exif_set_short (*buf + 10, n->order, (ExifShort) ((n->order == EXIF_BYTE_ORDER_INTEL) ? 'II' : 'MM'));
+                       exif_set_short (*buf + 10, n->order, (ExifShort) (
+                               (n->order == EXIF_BYTE_ORDER_INTEL) ?
+                               ('I' << 8) | 'I' :
+                               ('M' << 8) | 'M'));
                        exif_set_short (*buf + 12, n->order, (ExifShort) 0x2A);
                        exif_set_long (*buf + 14, n->order, (ExifShort) 8);
                        o2 += 2 + 8;
@@ -194,7 +197,7 @@ exif_mnote_data_olympus_load (ExifMnoteData *en,
                o2 += 6;
                exif_log (en->log, EXIF_LOG_CODE_DEBUG, "ExifMnoteDataOlympus",
                        "Parsing Nikon maker note (0x%02x, %02x, %02x, "
-                       "%02x, %02x, %02x, %02x, %02x, %02x)...",
+                       "%02x, %02x, %02x, %02x, %02x)...",
                        buf[o2 + 0], buf[o2 + 1], buf[o2 + 2], buf[o2 + 3], 
                        buf[o2 + 4], buf[o2 + 5], buf[o2 + 6], buf[o2 + 7]); 
 
index ca4f23c..8332da6 100644 (file)
@@ -159,7 +159,7 @@ mnote_pentax_entry_get_value (MnotePentaxEntry *entry,
                                  "Internal error (unknown value %i)", vs);
                        break;
                }
-               snprintf (val, maxlen, items[i].elem[j].string);
+               snprintf (val, maxlen, "%s", items[i].elem[j].string);
                break;
 
        case MNOTE_PENTAX_TAG_ZOOM: