From 390a2b755e0c5fff39b82ab9b41dabcb7d02327c Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 31 Oct 2022 00:57:44 +0100 Subject: [PATCH] dont offset based on len parity --- src/parse/reader.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parse/reader.rs b/src/parse/reader.rs index bf74d545..670c65af 100644 --- a/src/parse/reader.rs +++ b/src/parse/reader.rs @@ -245,7 +245,7 @@ impl FileReader { /// the first element and all the 0's, turning it into `[a, b, c, ...]`. fn decode_utf16(&mut self) { // remove the 0's - let limit = self.buf.len() / 2 + 1 + (self.buf.len() % 2); + let limit = self.buf.len() / 2 + 1; for i in 2..limit { self.buf.swap(i, i * 2 - 1);