Nothing was off by one.

This commit is contained in:
Myrddin Dundragon 2016-12-18 03:30:25 -05:00
parent d6ecace6bc
commit 47e1c707eb

View File

@ -227,7 +227,7 @@ impl Converter for BigEndian
// Strings start with the size of bytes to read as // Strings start with the size of bytes to read as
// a u64. So read that in and then we know how many // a u64. So read that in and then we know how many
// bytes make up the string. // bytes make up the string.
byte_count = BigEndian::bytes_to_u64(&buffer[0..U64_BYTES-1]); byte_count = BigEndian::bytes_to_u64(&buffer[0..U64_BYTES]);
if byte_count > 0 if byte_count > 0
{ {
@ -396,7 +396,7 @@ impl Converter for LittleEndian
// Strings start with the size of bytes to read as // Strings start with the size of bytes to read as
// a u64. So read that in and then we know how many // a u64. So read that in and then we know how many
// bytes make up the string. // bytes make up the string.
byte_count = BigEndian::bytes_to_u64(&buffer[0..U64_BYTES-1]); byte_count = BigEndian::bytes_to_u64(&buffer[0..U64_BYTES]);
if byte_count > 0 if byte_count > 0
{ {