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
1 changed files with 2 additions and 2 deletions

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) static void EDIT_WM_SetText(WND *wnd, EDITSTATE *es, LPARAM lParam, BOOL unicode)
{ {
LPWSTR text; LPWSTR text = NULL;
if(unicode) if(unicode)
text = (LPWSTR)lParam; text = (LPWSTR)lParam;
else else if (lParam)
{ {
LPCSTR textA = (LPCSTR)lParam; LPCSTR textA = (LPCSTR)lParam;
INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0); INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);