limit MultiByteToWideChar to the real size available, not the total

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4135 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2005-06-24 13:12:03 +00:00
parent 4ecca13fcd
commit bfc2b56cbf

View file

@ -83,7 +83,7 @@ void ReadVarLenArr(LPBYTE &seeker, char* &readInto, unsigned int uCodePage) {
seeker += sizeof(WORD); \
} \
else { \
int us = MultiByteToWideChar(m_uCodePage, 0, x, -1, (WCHAR*)seeker, dwSize); \
int us = MultiByteToWideChar(m_uCodePage, 0, x, -1, (WCHAR*)seeker, dwSize - DWORD(seeker - pbDlg)); \
if (!us) { \
throw runtime_error("WriteStringOrId - Unicode conversion failed."); \
} \