diff options
-rw-r--r-- | win32/win32.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c index c66ce614ff..18cf4f49e9 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -433,12 +433,13 @@ get_special_folder(int n, WCHAR *buf, size_t len) func = (get_path_func) get_proc_address("shell32", "SHGetPathFromIDListEx", NULL); } + if (!func && len < 260) return FALSE; if (SHGetSpecialFolderLocation(NULL, n, &pidl) == 0) { if (func) { f = func(pidl, buf, len, 0); } - else if (len >= 260) { + else { f = SHGetPathFromIDListW(pidl, buf); } SHGetMalloc(&alloc); |