From ac1d7a0b1eb54d5b10dca553be816c8fb0881e47 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 29 Jul 2016 17:13:54 +0200 Subject: [PATCH] Fixed some bugs --- lib/danog/PHP/StructTools.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/danog/PHP/StructTools.php b/lib/danog/PHP/StructTools.php index 9f10e12..dbbd975 100644 --- a/lib/danog/PHP/StructTools.php +++ b/lib/danog/PHP/StructTools.php @@ -419,9 +419,9 @@ class StructTools if (!is_int($result[$arraycount]) && !is_float($result[$arraycount])) { $result[$arraycount] = (int) $result[$arraycount]; } - if (is_float($result[$arraycount]) && $result[$arraycount] < PHP_INT_MAX) { +/* if (is_float($result[$arraycount]) && $result[$arraycount] < PHP_INT_MAX) { $result[$arraycount] = (int) $result[$arraycount]; - } + }*/ break; case 'float': if (!is_float($result[$arraycount])) { @@ -686,7 +686,7 @@ class StructTools $negative = false; } do { - $concat = ($number % 2).$concat; + $concat = $this->posmod($number, 2).$concat; $number = intval($number / 2); } while ($number > 0); $concat = str_pad($concat, $length, '0', STR_PAD_LEFT); @@ -697,7 +697,7 @@ class StructTools $concat = str_pad('', $length, '0'); } if (strlen($concat) > $length) { - trigger_error('Converted binary number is too long ('.strlen($concat).' > '.$length.').'); + trigger_error('Converted binary number '.$concat.' is too long ('.strlen($concat).' > '.$length.').'); } return $concat;