mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-21 19:32:30 +00:00
Replace alloca with malloc for win32 builds.
This commit is contained in:
parent
3d58770b4e
commit
341eacbc53
1 changed files with 8 additions and 2 deletions
|
@ -838,10 +838,16 @@ COM_AddDirectory (char *dir)
|
|||
printf("%p\n",pwd_ent);
|
||||
} else
|
||||
#endif
|
||||
home = getenv("HOME");
|
||||
|
||||
home = getenv("HOME");
|
||||
|
||||
if (home) {
|
||||
if (home)
|
||||
{
|
||||
#if !defined(_WIN32)
|
||||
tmp = alloca(strlen(home)+strlen(dir));
|
||||
#else
|
||||
tmp = malloc(strlen(home)+strlen(dir));
|
||||
#endif
|
||||
strcpy (tmp, home);
|
||||
strcat (tmp, dir+1); // skip leading ~
|
||||
dir=tmp;
|
||||
|
|
Loading…
Reference in a new issue