diff options
Diffstat (limited to 'azalea-nbt/src/decode.rs')
| -rwxr-xr-x | azalea-nbt/src/decode.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/azalea-nbt/src/decode.rs b/azalea-nbt/src/decode.rs index 5164bb0f..d4760807 100755 --- a/azalea-nbt/src/decode.rs +++ b/azalea-nbt/src/decode.rs @@ -40,10 +40,8 @@ impl Tag { // integer (thus 4 bytes) 7 => { let length = stream.read_i32::<BE>()?; - let mut bytes = Vec::with_capacity(length as usize); - for _ in 0..length { - bytes.push(stream.read_i8()?); - } + let mut bytes = vec![0; length as usize]; + stream.read_exact(&mut bytes)?; Tag::ByteArray(bytes) } // A length-prefixed modified UTF-8 string. The prefix is an |
