mirror of
https://github.com/gnustep/tools-make.git
synced 2025-04-22 22:00:49 +00:00
Fixed segmentation fault when GNUSTEP_SYSTEM_ROOT is not set
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@19978 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a8c4bb3d3a
commit
b298dcb954
1 changed files with 12 additions and 1 deletions
13
user_home.c
13
user_home.c
|
@ -238,7 +238,18 @@ int main (int argc, char** argv)
|
|||
}
|
||||
#else
|
||||
{
|
||||
strcpy(path, (const char*)getenv("GNUSTEP_SYSTEM_ROOT"));
|
||||
const char *gnustep_system_root = (const char*)getenv("GNUSTEP_SYSTEM_ROOT");
|
||||
|
||||
if (gnustep_system_root != 0)
|
||||
{
|
||||
strcpy(path, gnustep_system_root);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* On my machine the strcpy was segfaulting when
|
||||
* gnustep_system_root == 0. */
|
||||
path[0] = '\0';
|
||||
}
|
||||
}
|
||||
#endif
|
||||
strcat(path, SEP);
|
||||
|
|
Loading…
Reference in a new issue