From a33d7fc8c9e8fd68219100acc6595799e6725233 Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Tue, 29 Jul 2008 14:35:25 +0200 Subject: [PATCH] Fix some hackish usages of WideCharToMultiByte. --- dlls/comdlg32/fontdlg.c | 2 +- dlls/wininet/urlcache.c | 2 +- programs/winecfg/theme.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/comdlg32/fontdlg.c b/dlls/comdlg32/fontdlg.c index 2532f2ffc13..9174ce00d61 100644 --- a/dlls/comdlg32/fontdlg.c +++ b/dlls/comdlg32/fontdlg.c @@ -1072,7 +1072,7 @@ static LRESULT CFn_WMDestroy(HWND hwnd, WPARAM wParam, LPARAM lParam, LPCHOOSEFO LF_FACESIZE, lpcfa->lpLogFont->lfFaceName, LF_FACESIZE, 0, 0); if((lpcfw->Flags & CF_USESTYLE) && lpcfw->lpszStyle) { - len = WideCharToMultiByte(CP_ACP, 0, lpcfw->lpszStyle, -1, NULL, -1, 0, 0); + len = WideCharToMultiByte(CP_ACP, 0, lpcfw->lpszStyle, -1, NULL, 0, 0, 0); WideCharToMultiByte(CP_ACP, 0, lpcfw->lpszStyle, -1, lpcfa->lpszStyle, len, 0, 0); HeapFree(GetProcessHeap(), 0, lpcfw->lpszStyle); } diff --git a/dlls/wininet/urlcache.c b/dlls/wininet/urlcache.c index e175a7be01e..1cfa8de7ca8 100644 --- a/dlls/wininet/urlcache.c +++ b/dlls/wininet/urlcache.c @@ -2339,7 +2339,7 @@ static BOOL WINAPI CommitUrlCacheEntryInternal( /* skip container path prefix */ lpszLocalFileName += lstrlenW(pContainer->path); - WideCharToMultiByte(CP_ACP, 0, lpszLocalFileName, -1, achFile, -1, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, lpszLocalFileName, -1, achFile, MAX_PATH, NULL, NULL); pchLocalFileName = achFile; for (cDirectory = 0; cDirectory < pHeader->DirectoryCount; cDirectory++) diff --git a/programs/winecfg/theme.c b/programs/winecfg/theme.c index abd016d7744..cdab531d2ce 100644 --- a/programs/winecfg/theme.c +++ b/programs/winecfg/theme.c @@ -554,7 +554,7 @@ static void set_color_from_theme(WCHAR *keyName, COLORREF color) keyNameSize = WideCharToMultiByte(CP_ACP, 0, keyName, -1, keyNameA, 0, NULL, NULL); keyNameA = HeapAlloc(GetProcessHeap(), 0, keyNameSize); - WideCharToMultiByte(CP_ACP, 0, keyName, -1, keyNameA, -1, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, keyName, -1, keyNameA, keyNameSize, NULL, NULL); for (i=0; i