Skip to content

Commit

Permalink
Fixed direction of negative tiny_int
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanak-michal authored Oct 24, 2020
1 parent 1c8ffc2 commit d31d8fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PackStream/v1/Unpacker.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private function unpackInteger(int $marker, bool &$result = false): int
if ($marker >> 7 == 0b0) { //+TINY_INT
$output = $marker;
} elseif ($marker >> 4 == 0b1111) { //-TINY_INT
$output = 0b11110000 ^ $marker;
$output = -16 + (0b11110000 ^ $marker);
} elseif ($marker == 0xC8) { //INT_8
$output = unpack('c', $this->next(1))[1] ?? 0;
} elseif ($marker == 0xC9) { //INT_16
Expand Down

0 comments on commit d31d8fe

Please sign in to comment.