1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[utf8] fix bad wchar string alloc size in ComboBox_GetLBTextU()

This commit is contained in:
Pete Batard 2011-11-25 00:03:39 +00:00
parent f661e5c585
commit 96e4e64447

View file

@ -253,7 +253,7 @@ static __inline int ComboBox_GetLBTextU(HWND hCtrl, int index, char* lpString)
size = (int)SendMessageW(hCtrl, CB_GETLBTEXTLEN, (WPARAM)index, (LPARAM)0);
if (size < 0)
return size;
wlpString = (wchar_t*)calloc(size, sizeof(wchar_t));
wlpString = (wchar_t*)calloc(size+1, sizeof(wchar_t));
size = (int)SendMessageW(hCtrl, CB_GETLBTEXT, (WPARAM)index, (LPARAM)wlpString);
err = GetLastError();
if (size > 0)