Skip to content

Commit

Permalink
Fixed Win10's GetUserProfileDirectory() bug in stable-1.0 branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Oct 4, 2018
1 parent c65c196 commit 15073ad
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions platform/win32.c
Expand Up @@ -185,7 +185,6 @@ static char *getExePath(const char *argv0)
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 */
Expand Down Expand Up @@ -217,7 +216,7 @@ static int determineUserDir(void)
* 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 */
Expand Down

0 comments on commit 15073ad

Please sign in to comment.