23 lines
678 B
Diff
23 lines
678 B
Diff
--- a/src/win/winmain.c
|
|
+++ b/src/win/winmain.c
|
|
@@ -271,7 +271,9 @@
|
|
{
|
|
HMODULE hShell32;
|
|
FARPROC pSHGetSpecialFolderPath;
|
|
- static char dir[MAX_PATH] = "";
|
|
+ typedef UINT (CALLBACK* GETFOLDERPATH)
|
|
+ (HWND hwnd, LPSTR pszPath, int csidl, BOOL fCreate);
|
|
+ static char dir[MAX_PATH] = {'\0'};
|
|
|
|
if (dir[0])
|
|
return dir;
|
|
@@ -284,7 +286,7 @@
|
|
pSHGetSpecialFolderPath =
|
|
GetProcAddress(hShell32, "SHGetSpecialFolderPathA");
|
|
if (pSHGetSpecialFolderPath)
|
|
- (*pSHGetSpecialFolderPath)(NULL, dir, CSIDL_APPDATA, FALSE);
|
|
+ (*(GETFOLDERPATH)(pSHGetSpecialFolderPath))(NULL, dir, CSIDL_APPDATA, FALSE);
|
|
FreeModule(hShell32);
|
|
return dir;
|
|
}
|