iliaa           Tue May 12 12:34:55 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/standard/tests/strings bug38770.phpt 
    /php-src/ext/standard       pack.c 
  Log:
  
  Fixed bug #47564 (unpacking unsigned long 32bit bit endian returns wrong
  result)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug38770.phpt?r1=1.1.2.1&r2=1.1.2.1.2.1&diff_format=u
Index: php-src/ext/standard/tests/strings/bug38770.phpt
diff -u php-src/ext/standard/tests/strings/bug38770.phpt:1.1.2.1 
php-src/ext/standard/tests/strings/bug38770.phpt:1.1.2.1.2.1
--- php-src/ext/standard/tests/strings/bug38770.phpt:1.1.2.1    Sun Nov 19 
18:20:48 2006
+++ php-src/ext/standard/tests/strings/bug38770.phpt    Tue May 12 12:34:55 2009
@@ -12,7 +12,7 @@
 --EXPECT--     
 Array
 (
-    [1] => -30000
+    [1] => 4294937296
 )
 Array
 (
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/pack.c?r1=1.57.2.5.2.6.2.5&r2=1.57.2.5.2.6.2.6&diff_format=u
Index: php-src/ext/standard/pack.c
diff -u php-src/ext/standard/pack.c:1.57.2.5.2.6.2.5 
php-src/ext/standard/pack.c:1.57.2.5.2.6.2.6
--- php-src/ext/standard/pack.c:1.57.2.5.2.6.2.5        Wed Dec 31 11:15:45 2008
+++ php-src/ext/standard/pack.c Tue May 12 12:34:55 2009
@@ -15,7 +15,7 @@
    | Author: Chris Schneider <cschn...@relog.ch>                          |
    +----------------------------------------------------------------------+
  */
-/* $Id: pack.c,v 1.57.2.5.2.6.2.5 2008/12/31 11:15:45 sebastian Exp $ */
+/* $Id: pack.c,v 1.57.2.5.2.6.2.6 2009/05/12 12:34:55 iliaa Exp $ */
 
 #include "php.h"
 
@@ -784,6 +784,13 @@
                                                }
 
                                                v |= 
php_unpack(&input[inputpos], 4, issigned, map);
+                                               if (sizeof(long) > 4) {
+                                                       if (type == 'l') {
+                                                               v = (signed 
int) v; 
+                                                       } else {
+                                                               v = (unsigned 
int) v;
+                                                       }
+                                               }
                                                add_assoc_long(return_value, n, 
v);
                                                break;
                                        }



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

Reply via email to