diff options
Diffstat (limited to 'code/sys/sys_unix.c')
-rw-r--r-- | code/sys/sys_unix.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/code/sys/sys_unix.c b/code/sys/sys_unix.c index 21d0b57..c05fda5 100644 --- a/code/sys/sys_unix.c +++ b/code/sys/sys_unix.c @@ -231,7 +231,10 @@ char *Sys_Cwd( void ) { static char cwd[MAX_OSPATH]; - getcwd( cwd, sizeof( cwd ) - 1 ); + char *result = getcwd( cwd, sizeof( cwd ) - 1 ); + if( result != cwd ) + return NULL; + cwd[MAX_OSPATH-1] = 0; return cwd; |