cvs: php4(PHP_4_2_0) /ext/exif exif.c

From: Date: Thu, 04 Apr 2002 20:42:48 +0000
Subject: cvs: php4(PHP_4_2_0) /ext/exif exif.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-10876@lists.php.net to get a copy of this message
helly Thu Apr 4 15:42:48 2002 EDT Modified files: (Branch: PHP_4_2_0) /php4/ext/exif exif.c Log: removed calls to wctomb, wcstombs #leave UNICODE to user Index: php4/ext/exif/exif.c diff -u php4/ext/exif/exif.c:1.52.2.4 php4/ext/exif/exif.c:1.52.2.5 --- php4/ext/exif/exif.c:1.52.2.4 Wed Apr 3 14:51:26 2002 +++ php4/ext/exif/exif.c Thu Apr 4 15:42:47 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: exif.c,v 1.52.2.4 2002/04/03 19:51:26 derick Exp $ */ +/* $Id: exif.c,v 1.52.2.5 2002/04/04 20:42:47 helly Exp $ */ /* ToDos * @@ -77,11 +77,6 @@ #define FALSE 0 #endif -#ifndef MB_CUR_MAX - #define MB_CUR_MAX 8 - /* Should be a library constant */ -#endif - #define EXIT_FAILURE 1 #define EXIT_SUCCESS 0 @@ -1219,7 +1214,6 @@ } /* }}} */ -#ifdef EXIF_DEBUG /* {{{ exif_process_string_raw * Copy a string in Exif header to a character string returns length of allocated buffer if any. */ static int exif_process_string_raw(char **result,char *value,size_t byte_count) { @@ -1236,7 +1230,6 @@ return 0; } /* }}} */ -#endif /* {{{ exif_process_string * Copy a string in Exif header to a character string returns length of allocated buffer if any. */ @@ -1261,8 +1254,7 @@ * Process UserComment in IFD. */ static int exif_process_user_comment(char **pszInfoPtr,char *szEncoding,char *szValuePtr,int ByteCount) { - int a,l; - char mbBuffer[MB_CUR_MAX]; + int a; *szEncoding = '\0'; /* Copy the comment */ @@ -1272,19 +1264,7 @@ strcpy( szEncoding, szValuePtr); szValuePtr = szValuePtr+8; ByteCount -= 8; - l = 0; - a = 0; - while(((wchar_t*)szValuePtr)[a]) { - l += (int)wctomb( mbBuffer, *((wchar_t*)szValuePtr)); - if (sizeof(wchar_t)*a++ >= ByteCount) break; /* avoiding problems with corrupt headers */ - } - if (l>1) { - *pszInfoPtr = emalloc(l+1); - wcstombs(*pszInfoPtr, (wchar_t*)(szValuePtr), l+1); - (*pszInfoPtr)[l] = '\0'; - return l+1; - } - return 0; + return exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount); } if ( !memcmp(szValuePtr, "ASCII\0\0\0", 8)) { strcpy( szEncoding, szValuePtr); @@ -1303,7 +1283,7 @@ if (a) for (a=ByteCount-1;a && szValuePtr[a]==' ';a--) (szValuePtr)[a] = '\0'; /* normal text without encoding */ - return exif_process_string(pszInfoPtr,szValuePtr,ByteCount); + return exif_process_string(pszInfoPtr, szValuePtr, ByteCount); } /* }}} */

« previous php.cvs (#10876) next »