]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix(fs.c, windows, ucrt64): use GetCurrentDirectoryW instead of _wgetcwd on windows...
authorNaitLee <naitlee@disroot.org>
Sun, 20 Oct 2024 09:00:14 +0000 (17:00 +0800)
committerdivVerent <divVerent@gmail.com>
Fri, 25 Oct 2024 17:27:10 +0000 (13:27 -0400)
Signed-off-by: NaitLee <naitlee@disroot.org>
fs.c

diff --git a/fs.c b/fs.c
index 2ce128e86cf61fda5e11f477381bb469a4d26f34..e912fa4790d1903a7a3b4de2b6acf7580390f3fa 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -78,7 +78,7 @@
 
 // windows wchar helpers
 #ifdef WIN32
-# define MAX_OSWPATH (MAX_OSPATH * sizeof(wchar))
+# define MAX_OSWPATH MAX_OSPATH
 # define WPATHDEF(var) wchar var[MAX_OSWPATH]
 #else
 # define WPATHDEF(var) ;
@@ -2197,7 +2197,7 @@ static void FS_Init_Dir (void)
 #else
        // use the working directory
        #ifdef WIN32
-               _wgetcwd(fs_basedirw, sizeof(fs_basedirw));
+               GetCurrentDirectoryW(sizeof(fs_basedirw), fs_basedirw);
                NARROW(fs_basedirw, fs_basedir);
        #else
                getcwd(fs_basedir, sizeof(fs_basedir));