cellog          Sun Feb 15 18:52:11 2009 UTC

  Modified files:              
    /php-src/ext/phar   tar.c 
  Log:
  MFB: fix setting of 32-bit values on big-endian systems
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tar.c?r1=1.65&r2=1.66&diff_format=u
Index: php-src/ext/phar/tar.c
diff -u php-src/ext/phar/tar.c:1.65 php-src/ext/phar/tar.c:1.66
--- php-src/ext/phar/tar.c:1.65 Wed Dec 31 11:12:35 2008
+++ php-src/ext/phar/tar.c      Sun Feb 15 18:52:11 2009
@@ -1084,10 +1084,10 @@
 
 #ifdef WORDS_BIGENDIAN
 # define PHAR_SET_32(var, buffer) \
-       *(php_uint32 *)(var) = (((((unsigned char*)(buffer))[3]) << 24) \
-               | ((((unsigned char*)(buffer))[2]) << 16) \
-               | ((((unsigned char*)(buffer))[1]) << 8) \
-               | (((unsigned char*)(buffer))[0]))
+       *(php_uint32 *)(var) = (((((unsigned char*)&(buffer))[3]) << 24) \
+               | ((((unsigned char*)&(buffer))[2]) << 16) \
+               | ((((unsigned char*)&(buffer))[1]) << 8) \
+               | (((unsigned char*)&(buffer))[0]))
 #else
 # define PHAR_SET_32(var, buffer) *(php_uint32 *)(var) = (php_uint32) (buffer)
 #endif



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to