]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix(fs.c, win32): correct nBufferLength parameter for GetCurrentDirectoryW
authorNaitLee <naitli@foxmail.com>
Fri, 25 Oct 2024 13:21:38 +0000 (21:21 +0800)
committerdivVerent <divVerent@gmail.com>
Fri, 25 Oct 2024 17:27:10 +0000 (13:27 -0400)
fs.c

diff --git a/fs.c b/fs.c
index e912fa4790d1903a7a3b4de2b6acf7580390f3fa..72fc0056e4ccfc5f6b6b1f64878859afd579d089 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -2197,7 +2197,7 @@ static void FS_Init_Dir (void)
 #else
        // use the working directory
        #ifdef WIN32
-               GetCurrentDirectoryW(sizeof(fs_basedirw), fs_basedirw);
+               GetCurrentDirectoryW(sizeof(fs_basedirw) / sizeof(*fs_basedirw), fs_basedirw);
                NARROW(fs_basedirw, fs_basedir);
        #else
                getcwd(fs_basedir, sizeof(fs_basedir));