]> granicus.if.org Git - php/commitdiff
MFH: Fix handling of ini settings
authorMarcus Boerger <helly@php.net>
Fri, 30 May 2003 17:50:06 +0000 (17:50 +0000)
committerMarcus Boerger <helly@php.net>
Fri, 30 May 2003 17:50:06 +0000 (17:50 +0000)
ext/exif/exif.c

index 8adc41100f6defff9542bea933dcc35fdd7ac035..0f3d183de750eb3facd148f52b9f4e01ddc93298 100644 (file)
@@ -3669,6 +3669,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)
@@ -3692,12 +3702,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) {