summaryrefslogtreecommitdiff
path: root/ext/exif
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2007-02-24 14:28:09 +0000
committerMarcus Boerger <helly@php.net>2007-02-24 14:28:09 +0000
commit1b1c62d708662f560892ea067c973ee6121316c9 (patch)
treef5ac878b07a46c92781ebc50dd9812d0952d91b6 /ext/exif
parent0caa2be91f0c81e9d9dc09cd9d00a1815bd143db (diff)
downloadphp-git-1b1c62d708662f560892ea067c973ee6121316c9.tar.gz
- Make debug code really safe
Diffstat (limited to 'ext/exif')
-rw-r--r--ext/exif/exif.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 0a3e5beb19..dcd52587a6 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -1185,43 +1185,43 @@ char * exif_dump_data(int *dump_free, int format, int components, int length, in
case TAG_FMT_STRING:
case TAG_FMT_SBYTE:
dump = erealloc(dump, len + 4 + 1);
- snprintf(dump + len, 4, "0x%02X", *value_ptr);
+ snprintf(dump + len, 4 + 1, "0x%02X", *value_ptr);
len += 4;
value_ptr++;
break;
case TAG_FMT_USHORT:
case TAG_FMT_SSHORT:
dump = erealloc(dump, len + 6 + 1);
- snprintf(dump + len, 6, "0x%04X", php_ifd_get16s(value_ptr, motorola_intel));
+ snprintf(dump + len, 6 + 1, "0x%04X", php_ifd_get16s(value_ptr, motorola_intel));
len += 6;
value_ptr += 2;
break;
case TAG_FMT_ULONG:
case TAG_FMT_SLONG:
dump = erealloc(dump, len + 6 + 1);
- snprintf(dump + len, 6, "0x%04X", php_ifd_get32s(value_ptr, motorola_intel));
+ snprintf(dump + len, 6 + 1, "0x%04X", php_ifd_get32s(value_ptr, motorola_intel));
len += 6;
value_ptr += 4;
break;
case TAG_FMT_URATIONAL:
case TAG_FMT_SRATIONAL:
dump = erealloc(dump, len + 13 + 1);
- snprintf(dump + len, 13, "0x%04X/0x%04X", php_ifd_get32s(value_ptr, motorola_intel), php_ifd_get32s(value_ptr+4, motorola_intel));
+ snprintf(dump + len, 13 + 1, "0x%04X/0x%04X", php_ifd_get32s(value_ptr, motorola_intel), php_ifd_get32s(value_ptr+4, motorola_intel));
len += 13;
value_ptr += 8;
break;
}
if (components > 0) {
- dump = erealloc(dump, len + 4 + 1);
- snprintf(dump + len, 4, ", ");
+ dump = erealloc(dump, len + 2 + 1);
+ snprintf(dump + len, 2 + 1, ", ");
len += 2;
components--;
} else{
break;
}
}
- dump = erealloc(dump, len + 2 + 1);
- snprintf(dump + len, 2, "}");
+ dump = erealloc(dump, len + 1 + 1);
+ snprintf(dump + len, 1 + 1, "}");
return dump;
}
/* }}} */