Commit 2702da69 authored by Alexandre Julliard's avatar Alexandre Julliard

wordpad: Fix a compiler warning.

parent 85e87ae8
......@@ -724,7 +724,7 @@ static void set_default_font(void)
SendMessageW(hEditorWnd, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&fmt);
}
static void add_font(LPWSTR fontName, DWORD fontType, HWND hListWnd, NEWTEXTMETRICEXW *ntmc)
static void add_font(LPCWSTR fontName, DWORD fontType, HWND hListWnd, NEWTEXTMETRICEXW *ntmc)
{
COMBOBOXEXITEMW cbItem;
WCHAR buffer[MAX_PATH];
......@@ -742,7 +742,8 @@ static void add_font(LPWSTR fontName, DWORD fontType, HWND hListWnd, NEWTEXTMETR
else
break;
}
cbItem.pszText = fontName;
cbItem.pszText = HeapAlloc( GetProcessHeap(), 0, (lstrlenW(fontName) + 1)*sizeof(WCHAR) );
lstrcpyW( cbItem.pszText, fontName );
cbItem.mask |= CBEIF_LPARAM;
if(fontType & RASTER_FONTTYPE)
......@@ -750,6 +751,7 @@ static void add_font(LPWSTR fontName, DWORD fontType, HWND hListWnd, NEWTEXTMETR
cbItem.lParam = MAKELONG(fontType,fontHeight);
SendMessageW(hListWnd, CBEM_INSERTITEMW, 0, (LPARAM)&cbItem);
HeapFree( GetProcessHeap(), 0, cbItem.pszText );
}
static void dialog_choose_font(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment