Author: cwittich
Date: Mon Dec 10 21:49:56 2007
New Revision: 31129
URL:
http://svn.reactos.org/svn/reactos?rev=31129&view=rev
Log:
Alexandre Julliard : Fix a compiler warning. <julliard at winehq.org>
Modified:
trunk/reactos/base/applications/wordpad/wordpad.c
Modified: trunk/reactos/base/applications/wordpad/wordpad.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
==============================================================================
--- trunk/reactos/base/applications/wordpad/wordpad.c (original)
+++ trunk/reactos/base/applications/wordpad/wordpad.c Mon Dec 10 21:49:56 2007
@@ -771,7 +771,7 @@
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];
@@ -789,7 +789,8 @@
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)
@@ -797,6 +798,7 @@
cbItem.lParam = MAKELONG(fontType,fontHeight);
SendMessageW(hListWnd, CBEM_INSERTITEMW, 0, (LPARAM)&cbItem);
+ HeapFree( GetProcessHeap(), 0, cbItem.pszText );
}
static void dialog_choose_font(void)