Fixup error in binary operations.

This commit is contained in:
Benoît Burnichon
2015-03-09 21:33:28 +01:00
parent e17bdf83c9
commit 541d8a1d27

View File

@@ -192,7 +192,7 @@ class databox_status
$stat2 = self::hex2bin($app, substr($stat2, 2));
}
$stat1 = str_pad($stat1, 32, '0', STR_PAD_LEFT);
$stat2 = str_pad($stat1, 32, '0', STR_PAD_LEFT);
$stat2 = str_pad($stat2, 32, '0', STR_PAD_LEFT);
return decbin(bindec($stat1) & ~bindec($stat2));
}
@@ -206,9 +206,9 @@ class databox_status
$stat2 = self::hex2bin($app, substr($stat2, 2));
}
$stat1 = str_pad($stat1, 32, '0', STR_PAD_LEFT);
$stat2 = str_pad($stat1, 32, '0', STR_PAD_LEFT);
$stat2 = str_pad($stat2, 32, '0', STR_PAD_LEFT);
return decbin(hexdec($stat1) | hexdec($stat2));
return decbin(bindec($stat1) | bindec($stat2));
}
public static function dec2bin(Application $app, $status)