Fixed Win10's GetUserProfileDirectory() bug in stable-1.0 branch. stable-1.0
authorRyan C. Gordon <icculus@icculus.org>
Wed, 03 Oct 2018 22:45:05 -0400
branchstable-1.0
changeset 1648 93b4c3bc6b9d
parent 1390 60449ca1b00a
Fixed Win10's GetUserProfileDirectory() bug in stable-1.0 branch.
platform/win32.c
--- a/platform/win32.c	Fri Feb 17 20:48:02 2017 -0500
+++ b/platform/win32.c	Wed Oct 03 22:45:05 2018 -0400
@@ -185,7 +185,6 @@
 static int determineUserDir(void)
 {
     DWORD psize = 0;
-    char dummy[1];
     BOOL rc = 0;
     HANDLE processHandle;            /* Current process handle */
     HANDLE accessToken = NULL;       /* Security handle to process */
@@ -217,7 +216,7 @@
                  *  psize. Also note that the second parameter can't be
                  *  NULL or the function fails.
                  */
-                rc = GetUserProfileDirectory(accessToken, dummy, &psize);
+                rc = GetUserProfileDirectory(accessToken, NULL, &psize);
                 assert(!rc);  /* success?! */
 
                 /* Allocate memory for the profile directory */