]> granicus.if.org Git - php/commitdiff
Use safe_estrdup() instead.
authorMarcus Boerger <helly@php.net>
Fri, 30 May 2003 18:59:49 +0000 (18:59 +0000)
committerMarcus Boerger <helly@php.net>
Fri, 30 May 2003 18:59:49 +0000 (18:59 +0000)
# Thanks Sascha i didn't knew about that thing.

ext/exif/exif.c

index c035f3685d701f233453c888e27f5d98b29fb7d9..f568c8a822e82c5f109f10eb0005761fe20ebc09 100644 (file)
@@ -3669,16 +3669,6 @@ 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)
@@ -3702,12 +3692,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    = 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));
+       ImageInfo->encode_unicode    = safe_estrdup(EXIF_G(encode_unicode));
+       ImageInfo->decode_unicode_be = safe_estrdup(EXIF_G(decode_unicode_be));
+       ImageInfo->decode_unicode_le = safe_estrdup(EXIF_G(decode_unicode_le));
+       ImageInfo->encode_jis        = safe_estrdup(EXIF_G(encode_jis));
+       ImageInfo->decode_jis_be     = safe_estrdup(EXIF_G(decode_jis_be));
+       ImageInfo->decode_jis_le     = safe_estrdup(EXIF_G(decode_jis_le));
 
        if (php_stream_is(ImageInfo->infile, PHP_STREAM_IS_STDIO)) {
                if (VCWD_STAT(FileName, &st) >= 0) {