summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-05-30 17:47:36 +0000
committerMarcus Boerger <helly@php.net>2003-05-30 17:47:36 +0000
commit9b476c3ceb04c7a8827d238cd1e8aa61f654082e (patch)
tree1124186a92ab667bb14ea8cd44710441ad9f508c
parente88b74b8eca6d12392659710f8d98c39d2478bf8 (diff)
downloadphp-git-9b476c3ceb04c7a8827d238cd1e8aa61f654082e.tar.gz
MFH: Fix handling of ini settings
-rw-r--r--ext/exif/exif.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 9bc21ff4d4..f78f7a31fc 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -3753,6 +3753,16 @@ static int exif_discard_imageinfo(image_info_type *ImageInfo)
}
/* }}} */
+/* {{{ estrdupx */
+static inline char * estrdupx(const char* str)
+{
+ if (str) {
+ return estrdup(str);
+ }
+ return estrdup("");
+}
+/* }}} */
+
/* {{{ exif_read_file
*/
static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_thumbnail, int read_all TSRMLS_DC)
@@ -3776,12 +3786,12 @@ static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_t
ImageInfo->read_all = read_all;
ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_UNKNOWN;
- ImageInfo->encode_unicode = estrdup(EXIF_G(encode_unicode));
- ImageInfo->decode_unicode_be = estrdup(EXIF_G(decode_unicode_be));
- ImageInfo->decode_unicode_le = estrdup(EXIF_G(decode_unicode_le));
- ImageInfo->encode_jis = estrdup(EXIF_G(encode_jis));
- ImageInfo->decode_jis_be = estrdup(EXIF_G(decode_jis_be));
- ImageInfo->decode_jis_le = estrdup(EXIF_G(decode_jis_le));
+ ImageInfo->encode_unicode = estrdupx(EXIF_G(encode_unicode));
+ ImageInfo->decode_unicode_be = estrdupx(EXIF_G(decode_unicode_be));
+ ImageInfo->decode_unicode_le = estrdupx(EXIF_G(decode_unicode_le));
+ ImageInfo->encode_jis = estrdupx(EXIF_G(encode_jis));
+ ImageInfo->decode_jis_be = estrdupx(EXIF_G(decode_jis_be));
+ ImageInfo->decode_jis_le = estrdupx(EXIF_G(decode_jis_le));
if (php_stream_is(ImageInfo->infile, PHP_STREAM_IS_STDIO)) {
if (VCWD_STAT(FileName, &st) >= 0) {