wxMBConv_iconv: Fix wrong buffer size

This is an oversight in commit 878c265.
This commit is contained in:
rlbxku1r
2021-09-27 00:21:03 +09:00
parent 44fe94fad8
commit 7dcf004f0e

View File

@@ -2343,13 +2343,13 @@ wxMBConv_iconv::ToWChar(wchar_t *dst, size_t dstLen,
do
{
char* bufPtr = (char*)tbuf;
dstLen = 8 * SIZEOF_WCHAR_T;
dstLen = sizeof(tbuf);
cres = iconv(m2w,
ICONV_CHAR_CAST(&pszPtr), &srcLen,
&bufPtr, &dstLen );
res += 8 - (dstLen / SIZEOF_WCHAR_T);
res += (sizeof(tbuf) - dstLen) / SIZEOF_WCHAR_T;
}
while ((cres == (size_t)-1) && (errno == E2BIG));
}