From 96e4e64447b0c9d6481b54dcee77e9be5df7ed28 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Fri, 25 Nov 2011 00:03:39 +0000 Subject: [PATCH] [utf8] fix bad wchar string alloc size in ComboBox_GetLBTextU() --- msapi_utf8.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msapi_utf8.h b/msapi_utf8.h index a8c20e80..68233f01 100644 --- a/msapi_utf8.h +++ b/msapi_utf8.h @@ -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)