mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-15 16:41:22 +00:00
sys_win.c: properly check the returned value from GetCurrentDirectory()
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1384 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
52da7ede44
commit
4d4800785f
1 changed files with 4 additions and 2 deletions
|
@ -158,9 +158,11 @@ static char cwd[1024];
|
||||||
|
|
||||||
static void Sys_GetBasedir (char *argv0, char *dst, size_t dstsize)
|
static void Sys_GetBasedir (char *argv0, char *dst, size_t dstsize)
|
||||||
{
|
{
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
size_t rc;
|
||||||
|
|
||||||
if (GetCurrentDirectory(dstsize, dst) == 0)
|
rc = GetCurrentDirectory(dstsize, dst);
|
||||||
|
if (rc == 0 || rc > dstsize)
|
||||||
Sys_Error ("Couldn't determine current directory");
|
Sys_Error ("Couldn't determine current directory");
|
||||||
|
|
||||||
tmp = dst;
|
tmp = dst;
|
||||||
|
|
Loading…
Reference in a new issue