From 341eacbc536464f23ffa2e4cd27497c3d25b6183 Mon Sep 17 00:00:00 2001 From: Tony Tyson Date: Fri, 28 Apr 2000 02:52:00 +0000 Subject: [PATCH] Replace alloca with malloc for win32 builds. --- common/quakefs.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/quakefs.c b/common/quakefs.c index 93ed0e9..b20349f 100644 --- a/common/quakefs.c +++ b/common/quakefs.c @@ -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;