properly handle getcwd error in IdentifyVersion
if getcwd fails, the buffer contents will be undefined so we shall just overwrite it again with "."
This commit is contained in:
parent
7766dd2b22
commit
10fd31878f
1 changed files with 3 additions and 5 deletions
|
|
@ -1332,15 +1332,13 @@ static void IdentifyVersion(void)
|
|||
#endif
|
||||
|
||||
char tempsrb2path[256] = ".";
|
||||
getcwd(tempsrb2path, 256);
|
||||
if (getcwd(tempsrb2path, 256) == NULL)
|
||||
strcpy(tempsrb2path, ".");
|
||||
|
||||
// get the current directory (possible problem on NT with "." as current dir)
|
||||
if (!srb2waddir)
|
||||
{
|
||||
if (tempsrb2path[0])
|
||||
srb2waddir = tempsrb2path;
|
||||
else
|
||||
srb2waddir = srb2path;
|
||||
srb2waddir = tempsrb2path;
|
||||
}
|
||||
|
||||
#if (1) // reduce the amount of findfile by only using full cwd in this func
|
||||
|
|
|
|||
Loading…
Reference in a new issue