fix length calculation

This commit is contained in:
unxed 2025-02-25 14:00:30 +01:00 committed by GitHub
parent e807cf4acc
commit b557f6f6e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -624,10 +624,10 @@ void CItem::GetUnicodeString(UString &res, const AString &s, bool isComment, boo
iconv_close(cd); iconv_close(cd);
AString sUtf8CorrectLength;
size_t dstCorrectLength = dst - dstStart; size_t dstCorrectLength = dst - dstStart;
sUtf8CorrectLength.SetFrom(sUtf8, static_cast<unsigned>(dstCorrectLength)); sUtf8.ReleaseBuf_SetEnd(static_cast<unsigned>(dstCorrectLength));
if (ConvertUTF8ToUnicode(sUtf8CorrectLength, res) /*|| ignore_Utf8_Errors*/)
if (ConvertUTF8ToUnicode(sUtf8, res) /*|| ignore_Utf8_Errors*/)
return; return;
} }
} }