Commit 51f5308d authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Fix an uninitialized buffer.

parent 84580401
...@@ -41,15 +41,18 @@ int deltax = 0, deltay = 0; ...@@ -41,15 +41,18 @@ int deltax = 0, deltay = 0;
int width = 0, height = 0; int width = 0, height = 0;
BOOL isAldus; BOOL isAldus;
BOOL FileOpen(HWND hWnd, char *fn) BOOL FileOpen(HWND hWnd, char *fn, int fnsz)
{ {
OPENFILENAME ofn = { sizeof(OPENFILENAME), OPENFILENAME ofn = { sizeof(OPENFILENAME),
0, 0, NULL, NULL, 0, 0, NULL, 0, 0, NULL, NULL, 0, 0, NULL,
FN_LENGTH, NULL, 0, NULL, NULL, OFN_CREATEPROMPT | fnsz, NULL, 0, NULL, NULL,
OFN_SHOWHELP, 0, 0, NULL, 0, NULL }; OFN_SHOWHELP, 0, 0, NULL, 0, NULL };
ofn.lpstrFilter = "Metafiles\0*.wmf\0"; ofn.lpstrFilter = "Metafiles\0*.wmf\0";
ofn.hwndOwner = hWnd; ofn.hwndOwner = hWnd;
ofn.lpstrFile = fn; ofn.lpstrFile = fn;
if( fnsz < 1 )
return FALSE;
*fn = 0;
return GetOpenFileName(&ofn); return GetOpenFileName(&ofn);
} }
...@@ -84,7 +87,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, ...@@ -84,7 +87,7 @@ LRESULT CALLBACK WndProc(HWND hwnd,
case IDM_OPEN: case IDM_OPEN:
{ {
char filename[FN_LENGTH]; char filename[FN_LENGTH];
if (FileOpen(hwnd, filename)) { if (FileOpen(hwnd, filename, FN_LENGTH)) {
isAldus = FileIsPlaceable(filename); isAldus = FileIsPlaceable(filename);
if (isAldus) { if (isAldus) {
hmf = GetPlaceableMetaFile(hwnd, filename); hmf = GetPlaceableMetaFile(hwnd, filename);
...@@ -222,5 +225,3 @@ HMETAFILE GetPlaceableMetaFile( HWND hwnd, LPCSTR szFileName ) ...@@ -222,5 +225,3 @@ HMETAFILE GetPlaceableMetaFile( HWND hwnd, LPCSTR szFileName )
deltay = 0 ; deltay = 0 ;
return hmf; return hmf;
} }
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