From 47e1c707eb7c44af32571f6ce25813d5785390e2 Mon Sep 17 00:00:00 2001 From: Jason Travis Smith Date: Sun, 18 Dec 2016 03:30:25 -0500 Subject: [PATCH] Nothing was off by one. --- src/endian.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/endian.rs b/src/endian.rs index 31659e2..0618042 100644 --- a/src/endian.rs +++ b/src/endian.rs @@ -227,7 +227,7 @@ impl Converter for BigEndian // Strings start with the size of bytes to read as // a u64. So read that in and then we know how many // 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 { @@ -396,7 +396,7 @@ impl Converter for LittleEndian // Strings start with the size of bytes to read as // a u64. So read that in and then we know how many // 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 {