Guard against incoming string of NULL in WM_SETTEXT.

This commit is contained in:
James Hatheway 2001-01-12 23:01:41 +00:00 committed by Alexandre Julliard
parent 0b47b289a8
commit f3ea345b2d

View file

@ -4467,11 +4467,11 @@ static void EDIT_WM_SetFont(WND *wnd, EDITSTATE *es, HFONT font, BOOL redraw)
*/
static void EDIT_WM_SetText(WND *wnd, EDITSTATE *es, LPARAM lParam, BOOL unicode)
{
LPWSTR text;
LPWSTR text = NULL;
if(unicode)
text = (LPWSTR)lParam;
else
else if (lParam)
{
LPCSTR textA = (LPCSTR)lParam;
INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);