From b557f6f6e1307bae1e64cbd07c77d8472d462611 Mon Sep 17 00:00:00 2001 From: unxed Date: Tue, 25 Feb 2025 14:00:30 +0100 Subject: [PATCH] fix length calculation --- CPP/7zip/Archive/Zip/ZipItem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CPP/7zip/Archive/Zip/ZipItem.cpp b/CPP/7zip/Archive/Zip/ZipItem.cpp index 38a6733..8469087 100644 --- a/CPP/7zip/Archive/Zip/ZipItem.cpp +++ b/CPP/7zip/Archive/Zip/ZipItem.cpp @@ -624,10 +624,10 @@ void CItem::GetUnicodeString(UString &res, const AString &s, bool isComment, boo iconv_close(cd); - AString sUtf8CorrectLength; size_t dstCorrectLength = dst - dstStart; - sUtf8CorrectLength.SetFrom(sUtf8, static_cast(dstCorrectLength)); - if (ConvertUTF8ToUnicode(sUtf8CorrectLength, res) /*|| ignore_Utf8_Errors*/) + sUtf8.ReleaseBuf_SetEnd(static_cast(dstCorrectLength)); + + if (ConvertUTF8ToUnicode(sUtf8, res) /*|| ignore_Utf8_Errors*/) return; } }