Fix build on Windows after last commit.

This commit is contained in:
Yamagi 2020-03-16 15:55:31 +01:00
parent b2f0430c9f
commit a5eb0b16da
2 changed files with 5 additions and 5 deletions

View file

@ -94,10 +94,7 @@ main(int argc, char **argv)
// We need an argument. // We need an argument.
if (i != (argc - 1)) if (i != (argc - 1))
{ {
WCHAR wpath[MAX_OSPATH]; Q_strlcpy(cfgdir, argv[i + 1], sizeof(cfgdir));
MultiByteToWideChar(CP_UTF8, 0, argv[i + 1], -1, wpath, MAX_OSPATH);
Q_strlcpy(cfgdir, wpath, sizeof(cfgdir));
} }
else else
{ {

View file

@ -44,6 +44,9 @@ static HANDLE hinput, houtput;
// Game library handle // Game library handle
static HINSTANCE game_library; static HINSTANCE game_library;
// Config dir
char cfgdir[MAX_OSPATH] = CFGDIR;
// Buffer for the dedicated server console // Buffer for the dedicated server console
static char console_text[256]; static char console_text[256];
static size_t console_textlen; static size_t console_textlen;
@ -526,7 +529,7 @@ Sys_GetHomeDir(void)
} }
} }
snprintf(gdir, sizeof(gdir), "%s/%s/", profile, CFGDIR); snprintf(gdir, sizeof(gdir), "%s/%s/", profile, cfgdir);
return gdir; return gdir;
} }