diff --git a/src/t3ran13/ByteBuffer/ByteBuffer.php b/src/t3ran13/ByteBuffer/ByteBuffer.php index 7ff9b12..f87f14c 100644 --- a/src/t3ran13/ByteBuffer/ByteBuffer.php +++ b/src/t3ran13/ByteBuffer/ByteBuffer.php @@ -131,7 +131,7 @@ public function writeVStringLE($value, $offset = null) { if ($offset === null) { $offset = $this->currentOffset; } - $bytes = unpack('c*', $value); //string to bytes in int + $bytes = unpack('C*', $value); //string to bytes in int $total = count($bytes); for ($i = 0; $i < $total; $i++) { $this->buffer[$offset++] = pack('H*', base_convert($bytes[$i+1], 10, 16)); @@ -156,7 +156,7 @@ public function writeVStringBE($value, $offset = null) { if ($offset === null) { $offset = $this->currentOffset; } - $bytes = unpack('c*', $value); //string to bytes in int + $bytes = unpack('C*', $value); //string to bytes in int $total = count($bytes); for ($i = 0; $i < $total; $i++) { $this->buffer[$offset++] = pack('h*', base_convert($bytes[$i+1], 10, 16));