Oops, seems like Utils::readInt() is reading an unsigned long because of PHP silliness

This commit is contained in:
Shoghi Cervantes 2014-03-23 01:55:26 +01:00
parent d18952a06e
commit fd0fcecb46

View File

@ -705,6 +705,9 @@ class Utils{
public static function readInt($str){
list(, $unpacked) = @unpack("N", $str);
if($unpacked > 2147483647){
$unpacked -= 4294967296;
}
return (int) $unpacked;
}
@ -714,6 +717,9 @@ class Utils{
public static function readLInt($str){
list(, $unpacked) = @unpack("V", $str);
if($unpacked >= 2147483648){
$unpacked -= 4294967296;
}
return (int) $unpacked;
}