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:
Nicola Pero 2004-09-03 20:27:56 +00:00
parent a8c4bb3d3a
commit b298dcb954

View file

@ -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);